From 4409257c9c3149f3b0981ca31cbc9e7d7b4477d2 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Fri, 19 Dec 2014 09:56:32 -0700 Subject: [PATCH] Use INTERRUPTABLE_EXTENT in OS_pause when !HAVE_SIGSUSPEND. --- src/microcode/uxio.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/microcode/uxio.c b/src/microcode/uxio.c index bb681d133..8bbb260bc 100644 --- a/src/microcode/uxio.c +++ b/src/microcode/uxio.c @@ -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); } -- 2.25.1