From d7625a4d832fb661474dc89c656b05dc42397a83 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 21 Oct 2018 21:59:47 +0100 Subject: [PATCH 1/1] MacOS: fix spurious "child process failure" --- src/src/child.c | 11 ++++++++--- test/log/0276 | 2 +- test/stderr/0276 | 4 ++-- test/stdout/0276 | 2 +- 4 files changed, 12 insertions(+), 7 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; } } diff --git a/test/log/0276 b/test/log/0276 index b5a5613a3..6977d371d 100644 --- a/test/log/0276 +++ b/test/log/0276 @@ -8,7 +8,7 @@ 1999-03-02 09:44:33 10HmaY-0005vi-00 Completed 1999-03-02 09:44:33 10HmaX-0005vi-00 Completed 1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@test.ex U=CALLER P=local S=sss -1999-03-02 09:44:33 10HmaZ-0005vi-00 ** userx@test.ex R=r1 T=t1 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after DATA: 500 NO +1999-03-02 09:44:33 10HmaZ-0005vi-00 ** usery@test.ex R=r1 T=t1 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after DATA: 500 NO 1999-03-02 09:44:33 10HmbA-0005vi-00 <= <> R=10HmaZ-0005vi-00 U=EXIMUSER P=local S=sss 1999-03-02 09:44:33 10HmbA-0005vi-00 H=127.0.0.1 [127.0.0.1] Connection refused 1999-03-02 09:44:33 10HmbA-0005vi-00 == CALLER@test.ex R=r1 T=t1 defer (dd): Connection refused diff --git a/test/stderr/0276 b/test/stderr/0276 index 030801927..4f4270ec1 100644 --- a/test/stderr/0276 +++ b/test/stderr/0276 @@ -43,14 +43,14 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected 250 OK SMTP>> MAIL FROM: SMTP<< 250 OK - SMTP>> RCPT TO: + SMTP>> RCPT TO: SMTP<< 250 OK SMTP>> DATA SMTP<< 500 NO SMTP>> QUIT SMTP(close)>> LOG: MAIN - ** userx@test.ex R=r1 T=t1 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after DATA: 500 NO + ** usery@test.ex R=r1 T=t1 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after DATA: 500 NO LOG: MAIN <= <> R=10HmaZ-0005vi-00 U=EXIMUSER P=local S=sss delivering 10HmbA-0005vi-00 diff --git a/test/stdout/0276 b/test/stdout/0276 index 226da3b20..aebed478a 100644 --- a/test/stdout/0276 +++ b/test/stdout/0276 @@ -24,7 +24,7 @@ EHLO myhost.test.ex 250 OK MAIL FROM: 250 OK -RCPT TO: +RCPT TO: 250 OK DATA 500 NO -- 2.30.2