[LTP] [PATCH 3/3] syscalls/lseek10: cleanup && convert to new API

Cyril Hrubis chrubis@suse.cz
Wed Jun 28 18:18:22 CEST 2017


Hi!
> +#define SAFE_MKNOD(pathname, mode, dev) \
> +	safe_mknod(__FILE__, __LINE__, (pathname), (mode), (dev))
> +
>  #endif /* SAFE_MACROS_H__ */
> diff --git a/lib/safe_macros.c b/lib/safe_macros.c
> index 3ef9266..7ca1849 100644
> --- a/lib/safe_macros.c
> +++ b/lib/safe_macros.c
> @@ -908,3 +908,17 @@ pid_t safe_setsid(const char *file, const int lineno)
>  
>  	return rval;
>  }
> +
> +int safe_mknod(const char *file, const int lineno, const char *pathname,
> +	mode_t mode, dev_t dev)
> +{
> +	int rval;
> +
> +	rval = mknod(pathname, mode, dev);
> +	if (rval == -1) {
> +		tst_brkm(TBROK | TERRNO, NULL,
> +			 "%s:%d: mknod() failed", file, lineno);

I've changed this line to include the parameters passed to the
safe_mknod() to be included in the error message as well and pushed the
whole patchset, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list