]> granicus.if.org Git - strace/commit
Fix PID prefix printing in "strace -oLOG -ff -p1 -p2 -p3" case
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 9 Mar 2012 12:03:41 +0000 (13:03 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 9 Mar 2012 12:03:41 +0000 (13:03 +0100)
commitfd883380671693a4616881a9103491f9e67fc8ae
tree8a739634a2dee06cdf14e94f57ea70e12b82d76f
parente8172b79e3dd35a136f4dc4d4de9df5bb4565c01
Fix PID prefix printing in "strace -oLOG -ff -p1 -p2 -p3" case

In this case we were printing PIDs to LOG.* files
even though it is not necessary.

The fix is in the addition of "&& followfork < 2" condition.

* strace.c: Remove pflag_seen variable, add print_pid_pfx one.
(process_opt_p_list): Do not pflag_seen++.
(main): Use "nprocs != 0" condition instead of "pflag_seen != 0".
Set print_pid_pfx before entering main tracing loop.
(printleader): Use print_pid_pfx to decide whether to print pid prefix.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
strace.c