Commit bd057dc3 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

util: add parameter parenthesis to __open_proc statement in expr

Fixes small bug:
__open_proc() macro is called from parse_pid_loginuid as:
>	fd = __open_proc(pid, (ignore_noent) ? ENOENT : 0,
>			O_RDONLY, "loginuid");

So, ier parameter is badly expanded with current version:
>	if (__fd < 0 && (errno != (ignore_noent) ? ENOENT : 0)

Which in result does not hide "No such file" error on feature
test (at least with arm-gcc). Not a big deal, tho.
Reported-by: 's avataralex vk <avankemp@gmail.com>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 871d2180
......@@ -79,7 +79,7 @@ extern int do_open_proc(pid_t pid, int flags, const char *fmt, ...);
({ \
int __fd = do_open_proc(pid, flags, \
fmt, ##__VA_ARGS__); \
if (__fd < 0 && (errno != ier)) \
if (__fd < 0 && (errno != (ier))) \
pr_perror("Can't open %d/" fmt " on procfs", \
pid, ##__VA_ARGS__); \
\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment