summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-10-21 21:59:47 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2018-10-21 22:01:54 +0100
commitd7625a4d832fb661474dc89c656b05dc42397a83 (patch)
tree1ddf4fa2b560eead70c9e375c4e4e7d8b4132fad /src
parentc2a1bba0d1fe5e19f93c92544422036814695c45 (diff)
MacOS: fix spurious "child process failure"
Diffstat (limited to 'src')
-rw-r--r--src/src/child.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/src/child.c b/src/src/child.c
index 085f26600..2262678eb 100644
--- a/src/src/child.c
+++ b/src/src/child.c
@@ -517,13 +517,18 @@ for(;;)
if (rc == pid)
{
int lowbyte = status & 255;
- if (lowbyte == 0) yield = (status >> 8) & 255;
- else yield = -lowbyte;
+ yield = lowbyte == 0 ? (status >> 8) & 255 : -lowbyte;
break;
}
if (rc < 0)
{
- yield = (errno == EINTR && sigalrm_seen)? -256 : -257;
+ /* This "shouldn't happen" test does happen on MacOS: for some reason
+ I do not understand we seems to get an alarm signal despite not having
+ an active alarm set. There seems to be only one, so just go round again. */
+
+ if (errno == EINTR && sigalrm_seen && timeout <= 0) continue;
+
+ yield = (errno == EINTR && sigalrm_seen) ? -256 : -257;
break;
}
}