From: "Steven Rostedt (Google)" <rostedt@xxxxxxxxxxx> The variable that checks return status in daemonize_start() is "rc". To be consistent with the rest of the code, change it to "ret". Also check for less than zero instead of -1. Signed-off-by: Steven Rostedt (Google) <rostedt@xxxxxxxxxxx> --- tracecmd/trace-record.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tracecmd/trace-record.c b/tracecmd/trace-record.c index c943f486291e..022c27ffc294 100644 --- a/tracecmd/trace-record.c +++ b/tracecmd/trace-record.c @@ -1655,7 +1655,7 @@ static void daemonize_start(void) int devnull; int status; int pid; - int rc; + int ret; pid = fork(); if (pid == -1) @@ -1719,12 +1719,12 @@ static void daemonize_start(void) die("daemonize: sigaction failed"); do { - rc = waitpid(pid, &status, 0); - } while (!child_detached && ((rc == -1) && (errno == EINTR))); + ret = waitpid(pid, &status, 0); + } while (!child_detached && ((ret < 0) && (errno == EINTR))); if (child_detached) exit(0); - else if (rc == pid) + else if (ret == pid) exit(WIFEXITED(status)); else die("daemonize: waitpid failed"); -- 2.42.0