aboutsummaryrefslogtreecommitdiff
path: root/src/rc
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2020-11-29 21:22:43 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2020-11-29 21:22:43 -0600
commitda30767353eb1cc13826176bf19308a05c7bade4 (patch)
tree7892f968454bc8f6d52fe212dd63a64c6d999c69 /src/rc
parent57d9528a0bc64366ea3e0fbbb21b1282ce5c1212 (diff)
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.
Diffstat (limited to 'src/rc')
-rw-r--r--src/rc/supervise-daemon.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index ea9e5333..d43f1031 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -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));