From bd057dc3ad0618650535f01636cb5cedbf246da1 Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Thu, 21 Apr 2016 14:27:31 +0300 Subject: [PATCH] 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 Signed-off-by: Dmitry Safonov Signed-off-by: Pavel Emelyanov --- criu/include/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/include/util.h b/criu/include/util.h index 2d6fa590e..8efa1a849 100644 --- a/criu/include/util.h +++ b/criu/include/util.h @@ -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__); \ \