diff options
author | Mattias Andrée <maandree@member.fsf.org> | 2015-12-29 21:45:34 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@member.fsf.org> | 2015-12-29 21:45:34 +0100 |
commit | 4b2206f9ec3ce66dfd4d358bf43c6623e712e1a7 (patch) | |
tree | 2c27c4f821d226efb5b9f50c83847c6a8e8ed1e4 | |
parent | close the timers when running job/hook (diff) | |
download | sat-4b2206f9ec3ce66dfd4d358bf43c6623e712e1a7.tar.gz sat-4b2206f9ec3ce66dfd4d358bf43c6623e712e1a7.tar.bz2 sat-4b2206f9ec3ce66dfd4d358bf43c6623e712e1a7.tar.xz |
just make real sure that we do not quit whilst there are queued jobs
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
-rw-r--r-- | src/satd-diminished.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/satd-diminished.c b/src/satd-diminished.c index 43017fa..5316398 100644 --- a/src/satd-diminished.c +++ b/src/satd-diminished.c @@ -187,6 +187,7 @@ main(int argc, char *argv[], char *envp[]) int fd = -1, rc = 0, accepted = 0, r; unsigned char type; fd_set fdset; + struct stat attr; /* Set up signal handlers. */ t (signal(SIGHUP, sighandler) == SIG_ERR); @@ -197,6 +198,11 @@ again: if (accepted && (timer_pid == NO_TIMER_SPAWNED)) { t (r = is_timer_set(BOOT_FILENO), r < 0); if (r) goto not_done; t (r = is_timer_set(REAL_FILENO), r < 0); if (r) goto not_done; + t (fstat(STATE_FILENO, &attr)); + if (attr.st_size > (off_t)sizeof(size_t)) { + t (spawn(-1, -1, argv, envp)); + goto not_done; + } goto done; } not_done: |