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: alex vk <avankemp@gmail.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Dmitry Safonov 2016-04-21 14:27:31 +03:00 committed by Pavel Emelyanov
parent 871d21807b
commit bd057dc3ad

View file

@ -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__); \
\