[exim-cvs] MacOS: fix spurious "child process failure"

Top Page
Delete this message
Reply to this message
Author: Exim Git Commits Mailing List
Date:  
To: exim-cvs
Subject: [exim-cvs] MacOS: fix spurious "child process failure"
Gitweb: https://git.exim.org/exim.git/commitdiff/d7625a4d832fb661474dc89c656b05dc42397a83
Commit:     d7625a4d832fb661474dc89c656b05dc42397a83
Parent:     c2a1bba0d1fe5e19f93c92544422036814695c45
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun Oct 21 21:59:47 2018 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun Oct 21 22:01:54 2018 +0100


    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 085f266..2262678 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 b5a5613..6977d37 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@??? U=CALLER P=local S=sss
-1999-03-02 09:44:33 10HmaZ-0005vi-00 ** userx@??? 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@??? 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@??? R=r1 T=t1 defer (dd): Connection refused
diff --git a/test/stderr/0276 b/test/stderr/0276
index 0308019..4f4270e 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@???>
   SMTP<< 250 OK
-  SMTP>> RCPT TO:<userx@???>
+  SMTP>> RCPT TO:<usery@???>
   SMTP<< 250 OK
   SMTP>> DATA
   SMTP<< 500 NO
   SMTP>> QUIT
   SMTP(close)>>
 LOG: MAIN
-  ** userx@??? R=r1 T=t1 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after DATA: 500 NO
+  ** usery@??? 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 226da3b..aebed47 100644
--- a/test/stdout/0276
+++ b/test/stdout/0276
@@ -24,7 +24,7 @@ EHLO myhost.test.ex
 250 OK
 MAIL FROM:<CALLER@???>
 250 OK
-RCPT TO:<userx@???>
+RCPT TO:<usery@???>
 250 OK
 DATA
 500 NO