]> granicus.if.org Git - strace/commitdiff
clone: print clone flags without truncation
authorDmitry V. Levin <ldv@altlinux.org>
Sun, 25 Dec 2016 22:17:38 +0000 (22:17 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Sun, 25 Dec 2016 22:17:38 +0000 (22:17 +0000)
The flags argument is defined in kernel as unsigned long,
so change its decoding to avoid truncation.

* clone.c (SYS_FUNC(clone)): Change flags type from unsigned long
to kernel_ureg_t, print it using printflags64 instead of printflags.

clone.c

diff --git a/clone.c b/clone.c
index 3bc1e22ec7d5407d8fc82441949769f9d2f31b46..81b1ba0de59af4aa573512ac9cbfcd3651c0033f 100644 (file)
--- a/clone.c
+++ b/clone.c
@@ -98,7 +98,7 @@ SYS_FUNC(clone)
 {
        if (exiting(tcp)) {
                const char *sep = "|";
-               unsigned long flags = tcp->u_arg[ARG_FLAGS];
+               kernel_ureg_t flags = tcp->u_arg[ARG_FLAGS];
                tprints("child_stack=");
                printaddr(tcp->u_arg[ARG_STACK]);
                tprints(", ");
@@ -108,7 +108,7 @@ SYS_FUNC(clone)
                                tcp->u_arg[ARG_STACKSIZE]);
 #endif
                tprints("flags=");
-               if (!printflags(clone_flags, flags &~ CSIGNAL, NULL))
+               if (!printflags64(clone_flags, flags &~ CSIGNAL, NULL))
                        sep = "";
                if ((flags & CSIGNAL) != 0)
                        tprintf("%s%s", sep, signame(flags & CSIGNAL));