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>
This commit is contained in:
Wang Chao 2010-09-02 15:08:59 +08:00 committed by Dmitry V. Levin
parent 21b8db4eb9
commit cbdd1900a1

View File

@ -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;