diff options
author | Wang Chao <wang.chao@cn.fujitsu.com> | 2010-09-02 15:08:59 +0800 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2010-09-04 11:05:45 +0000 |
commit | cbdd1900a16016343c172db09fc48a83e7fa22ac (patch) | |
tree | 0471a2014237bd408cecebc6a8d124613a4f1e90 /process.c | |
parent | 21b8db4eb966a6098c7cd10bd6cf0ce8ec59cab8 (diff) | |
download | strace-cbdd1900a16016343c172db09fc48a83e7fa22ac.tar.gz strace-cbdd1900a16016343c172db09fc48a83e7fa22ac.tar.bz2 strace-cbdd1900a16016343c172db09fc48a83e7fa22ac.tar.xz |
Fix printing clone flags
When we trace clone() syscall with only exit signal as clone
flags, strace would print an unnecessary OR operator.
* process.c (sys_clone): Fix this.
Signed-off-by: Wang Chao <wang.chao@cn.fujitsu.com>
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -618,6 +618,7 @@ sys_clone(tcp) struct tcb *tcp; { if (exiting(tcp)) { + const char *sep = "|"; unsigned long flags = tcp->u_arg[ARG_FLAGS]; tprintf("child_stack=%#lx, ", tcp->u_arg[ARG_STACK]); # ifdef ARG_STACKSIZE @@ -626,9 +627,10 @@ struct tcb *tcp; tcp->u_arg[ARG_STACKSIZE]); # endif tprintf("flags="); - printflags(clone_flags, flags &~ CSIGNAL, NULL); + if (!printflags(clone_flags, flags &~ CSIGNAL, NULL)) + sep = ""; if ((flags & CSIGNAL) != 0) - tprintf("|%s", signame(flags & CSIGNAL)); + tprintf("%s%s", sep, signame(flags & CSIGNAL)); if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0) return 0; |