* strace.c (main): Initialize exit_code with 1 when no processes
has been attached.
* strace.1: Document it.
* NEWS: Mention this change.
Noteworthy changes in release ?.?? (????-??-??)
===============================================
+* Changes in behavior
+ * When using -p option without a command and no processes has been attached,
+ strace exits with exit status 1.
+
Noteworthy changes in release 4.13 (2016-07-26)
===============================================
is used.
.LP
When using
-.BR \-p ,
+.B \-p
+without a
+.IR command ,
the exit status of
.B strace
-is zero unless there was an unexpected error in doing the tracing.
+is zero unless no processes has been attached or there was an unexpected error
+in doing the tracing.
.SH "SETUID INSTALLATION"
If
.B strace
/* Are we "strace PROG" and need to hide everything until execve? */
bool hide_log_until_execve = 0;
-static int exit_code = 0;
+static int exit_code;
static int strace_child = 0;
static int strace_tracer_pid = 0;
{
init(argc, argv);
+ exit_code = !nprocs;
+
while (trace())
;