[LTP] [PATCH v3 2/3] safe_open, safe_openat: Fix undefined behaviour in vararg handling

Cyril Hrubis chrubis@suse.cz
Wed Nov 30 15:06:29 CET 2022


Hi!
> +#ifndef __OPEN_NEEDS_MODE
> + #define __OPEN_NEEDS_MODE(oflag) \
> +	(((oflag) & O_CREAT) != 0 || ((oflag) & O_TMPFILE) == O_TMPFILE)
> +#endif

I suppose that it would be a bit cleaner just to define our macro
TST_OPEN_NEEDS_MODE() instead.

Other than that it looks good.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list