diff options
author | Marius Bakke <mbakke@fastmail.com> | 2017-09-02 15:57:56 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2017-09-02 15:57:56 +0200 |
commit | 30dfac27a5642c36e7bb1ba7966566864ba2d28d (patch) | |
tree | 3b59623014eeea1df02cda5f926d803b9a36a828 /gnu/services/base.scm | |
parent | d2ee294c0400ac8f2a10f10c3c9644da513a3712 (diff) | |
parent | 65e4109cdc96fbaee088f50d0138af8acef43141 (diff) | |
download | patches-30dfac27a5642c36e7bb1ba7966566864ba2d28d.tar patches-30dfac27a5642c36e7bb1ba7966566864ba2d28d.tar.gz |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services/base.scm')
-rw-r--r-- | gnu/services/base.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 54bd9ca2fb..5001298ab3 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -456,6 +456,19 @@ in KNOWN-MOUNT-POINTS when it is stopped." (delete-file #$%do-not-kill-file))) (let wait () + ;; Reap children, if any, so that we don't end up with + ;; zombies and enter an infinite loop. + (let reap-children () + (define result + (false-if-exception + (waitpid WAIT_ANY (if (null? omitted-pids) + 0 + WNOHANG)))) + + (when (and (pair? result) + (not (zero? (car result)))) + (reap-children))) + (let ((pids (processes))) (unless (lset= = pids (cons 1 omitted-pids)) (format #t "waiting for process termination\ |