]> granicus.if.org Git - strace/commitdiff
sys_epoll_create1: decode flag arguments correctly
authorMike Frysinger <vapier@gentoo.org>
Fri, 14 Oct 2011 02:33:45 +0000 (22:33 -0400)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 14 Oct 2011 10:45:19 +0000 (10:45 +0000)
* desc.c (epollflags): Define.
(sys_epoll_create1): Use epollflags to printflags. Change "O" to "EPOLL".

Reported-by: Марк Коренберг <socketpair@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
desc.c

diff --git a/desc.c b/desc.c
index fad6cfed553ff909010f42473b0f96ccd5e88a8f..ee9aacc631e9db752e28b973a83c68174b1dd463 100644 (file)
--- a/desc.c
+++ b/desc.c
@@ -694,11 +694,21 @@ sys_epoll_create(struct tcb *tcp)
        return 0;
 }
 
+static const struct xlat epollflags[] = {
+#ifdef EPOLL_CLOEXEC
+       { EPOLL_CLOEXEC,        "EPOLL_CLOEXEC" },
+#endif
+#ifdef EPOLL_NONBLOCK
+       { EPOLL_NONBLOCK,       "EPOLL_NONBLOCK"        },
+#endif
+       { 0,            NULL            }
+};
+
 int
 sys_epoll_create1(struct tcb *tcp)
 {
        if (entering(tcp))
-               printflags(open_mode_flags, tcp->u_arg[0], "O_???");
+               printflags(epollflags, tcp->u_arg[0], "EPOLL_???");
        return 0;
 }