diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2018-10-21 21:59:47 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2018-10-21 22:01:54 +0100 |
commit | d7625a4d832fb661474dc89c656b05dc42397a83 (patch) | |
tree | 1ddf4fa2b560eead70c9e375c4e4e7d8b4132fad | |
parent | c2a1bba0d1fe5e19f93c92544422036814695c45 (diff) |
MacOS: fix spurious "child process failure"
-rw-r--r-- | src/src/child.c | 11 | ||||
-rw-r--r-- | test/log/0276 | 2 | ||||
-rw-r--r-- | test/stderr/0276 | 4 | ||||
-rw-r--r-- | 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:<CALLER@test.ex> SMTP<< 250 OK - SMTP>> RCPT TO:<userx@test.ex> + SMTP>> RCPT TO:<usery@test.ex> 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:<CALLER@test.ex> 250 OK -RCPT TO:<userx@test.ex> +RCPT TO:<usery@test.ex> 250 OK DATA 500 NO |