Use INTERRUPTABLE_EXTENT in OS_pause when !HAVE_SIGSUSPEND.
authorMatt Birkholz <puck@birchwood-abbey.net>
Fri, 19 Dec 2014 16:56:32 +0000 (09:56 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Fri, 19 Dec 2014 16:56:32 +0000 (09:56 -0700)
src/microcode/uxio.c

index bb681d1338d8aa4ec24e53ac623047618b3bf70f..8bbb260bc939d9fc66c290c00f442f1031e6c946 100644 (file)
@@ -874,12 +874,16 @@ OS_pause (void)
        n = SELECT_INTERRUPT;
     }
   UX_sigprocmask (SIG_SETMASK, &old, NULL);
-  return (n);
-#else
-  /* Wait-for-io must spin. */
-  return
-    ((OS_process_any_status_change ())
-     ? SELECT_PROCESS_STATUS_CHANGE
-     : SELECT_INTERRUPT);
+#else /* not HAVE_SIGSUSPEND */
+  INTERRUPTABLE_EXTENT
+    (n, (((OS_process_any_status_change ())
+         || (pending_interrupts_p ()))
+        ? ((errno = EINTR), (-1))
+        : ((UX_pause ()), (0))));
+  if (OS_process_any_status_change())
+    n = SELECT_PROCESS_STATUS_CHANGE;
+  else
+    n = SELECT_INTERRUPT;
 #endif
+  return (n);
 }