]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
pid is signed, so give it a default value of -1
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 27 Aug 2021 23:05:13 +0000 (18:05 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Fri, 27 Aug 2021 23:05:13 +0000 (18:05 -0500)
src/lib/server/exec.c

index 9f7d683d6e4ed02d99183a5d8096ac78bb0fc72d..6de1528de3ee77c3edbd8c20303760e94d1cf53d 100644 (file)
@@ -952,7 +952,7 @@ static void exec_waitpid(fr_event_list_t *el, UNUSED pid_t pid, int status, void
                RWDEBUG("Failed reaping PID %i: %s", exec->pid, fr_syserror(errno));
        /*
         *      Either something cleaned up the process before us
-        *      (bad!), or the notification system is broke
+        *      (bad!), or the notification system is broken
         *      (also bad!)
         *
         *      This could be caused by 3rd party libraries.
@@ -977,7 +977,7 @@ static void exec_waitpid(fr_event_list_t *el, UNUSED pid_t pid, int status, void
                RDEBUG("Program exited due to unknown status %d", exec->status);
                exec->status = -status;
        }
-       exec->pid = 0;
+       exec->pid = -1; /* pid_t is signed */
 
        if (exec->ev) fr_event_timer_delete(&exec->ev);
 
@@ -1184,6 +1184,7 @@ int fr_exec_wait_start_io(TALLOC_CTX *ctx, fr_exec_state_t *exec, request_t *req
        *exec = (fr_exec_state_t){
                .request = request,
                .vps = env_pairs,
+               .pid = -1,
                .stdout_fd = -1,
                .stderr_fd = -1,
                .stdin_fd = -1,