aboutsummaryrefslogtreecommitdiff
path: root/src/rc/supervise-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rc/supervise-daemon.c')
-rw-r--r--src/rc/supervise-daemon.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index 8d56b8d4..24cc56fa 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -425,6 +425,7 @@ static void supervisor(char *exec, char **argv)
FILE *fp;
int i;
int nkilled;
+ struct timespec ts;
time_t respawn_now= 0;
time_t first_spawn= 0;
@@ -497,7 +498,9 @@ static void supervisor(char *exec, char **argv)
if (nkilled > 0)
syslog(LOG_INFO, "killed %d processes", nkilled);
} else {
- sleep(respawn_delay);
+ ts.tv_sec = respawn_delay;
+ ts.tv_nsec = 0;
+ nanosleep(&ts, NULL);
if (respawn_max > 0 && respawn_period > 0) {
respawn_now = time(NULL);
if (first_spawn == 0)