Set exit status to 1 if strace has not traced any processes
* strace.c (main): Initialize exit_code with 1 when no processes has been attached. * strace.1: Document it. * NEWS: Mention this change.
This commit is contained in:
parent
2ddb73ddd3
commit
b9bc216fdd
4
NEWS
4
NEWS
@ -1,6 +1,10 @@
|
||||
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)
|
||||
===============================================
|
||||
|
||||
|
7
strace.1
7
strace.1
@ -601,10 +601,13 @@ unless
|
||||
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
|
||||
|
4
strace.c
4
strace.c
@ -138,7 +138,7 @@ static bool skip_one_b_execve = 0;
|
||||
/* 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;
|
||||
|
||||
@ -2387,6 +2387,8 @@ main(int argc, char *argv[])
|
||||
{
|
||||
init(argc, argv);
|
||||
|
||||
exit_code = !nprocs;
|
||||
|
||||
while (trace())
|
||||
;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user