From 8537cc982e67d548b08dcc887ff32d338e7ba3e4 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Fri, 28 Jul 2017 18:08:46 -0500 Subject: [PATCH] Fixed no-op loop hang --- src/postfork.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/postfork.cpp b/src/postfork.cpp index 1e6e9fd29..ecfd910fe 100644 --- a/src/postfork.cpp +++ b/src/postfork.cpp @@ -82,8 +82,9 @@ bool child_set_group(job_t *j, process_t *p) { //because we are SIGSTOPing the previous job in the chain. Sometimes we have to try a few //times to get the kernel to see the new group. (Linux 4.4.0) int failure = setpgid(p->pid, j->pgid); - while (failure == -1 && errno == EPERM) { + while (failure == -1 && (errno == EPERM || errno == EINTR)) { debug_safe(2, "Retrying setpgid in child process"); + failure = setpgid(p->pid, j->pgid); } // TODO: Figure out why we're testing whether the pgid is correct after attempting to // set it failed. This was added in commit 4e912ef8 from 2012-02-27.