summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Syromiatnikov <esyr@redhat.com>2017-12-31 18:14:05 +0100
committerDmitry V. Levin <ldv@altlinux.org>2019-05-21 23:30:35 +0000
commit29c4f91a03e3df5a1793b64cb595568dd8fe5f59 (patch)
tree19377e876f77d3857b708409541f057d300b0eed
parent5239cc4c6ce852a2383abea302bfa36231230234 (diff)
downloadstrace-29c4f91a03e3df5a1793b64cb595568dd8fe5f59.tar.gz
strace.c: move argc+daemonized check to tracing_backend_init
This check is also specific to the ptrace tracing backend. * strace.c (init): Mave !argc && daemonized_tracer check... (tracing_backend_init): ...here.
-rw-r--r--strace.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/strace.c b/strace.c
index ab93dead3..fd235e131 100644
--- a/strace.c
+++ b/strace.c
@@ -1626,6 +1626,9 @@ tracing_backend_init(int argc, char *argv[])
if (!nprocs && !argc)
error_msg_and_help("must have PROG [ARGS] or -p PID");
+ if (!argc && daemonized_tracer)
+ error_msg_and_help("PROG [ARGS] must be specified with -D");
+
if (followfork)
ptrace_setoptions |= PTRACE_O_TRACECLONE |
PTRACE_O_TRACEFORK |
@@ -1837,10 +1840,6 @@ init(int argc, char *argv[])
if (argc < 0)
error_msg_and_help("must have command line arguments");
- if (!argc && daemonized_tracer) {
- error_msg_and_help("PROG [ARGS] must be specified with -D");
- }
-
if (optF) {
if (followfork) {
error_msg("deprecated option -F ignored");