supervise-daemon: do not spawn a process if we are exiting

This fixes #375 and allows us to not add another level of indentation in
the supervisor loop.
This commit is contained in:
William Hubbs 2020-11-29 21:22:43 -06:00
parent 57d9528a0b
commit da30767353

View File

@ -648,6 +648,8 @@ static void supervisor(char *exec, char **argv)
ts.tv_sec = respawn_delay;
ts.tv_nsec = 0;
nanosleep(&ts, NULL);
if (exiting)
continue;
child_pid = fork();
if (child_pid == -1) {
syslog(LOG_ERR, "%s: fork: %s", applet, strerror(errno));