From: Matt Birkholz Date: Thu, 6 Sep 2012 15:58:24 +0000 (-0700) Subject: Fix OS_pause on Unix to correctly restore the sigmask. X-Git-Tag: release-9.2.0~221 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=fbc427ca6fb9053fc6fd43ade8064156354ae51c;p=mit-scheme.git Fix OS_pause on Unix to correctly restore the sigmask. --- diff --git a/src/microcode/uxio.c b/src/microcode/uxio.c index 02f91a566..2781a0182 100644 --- a/src/microcode/uxio.c +++ b/src/microcode/uxio.c @@ -857,18 +857,24 @@ OS_pause (void) { #ifdef HAVE_SIGSUSPEND sigset_t old, new; + int n; UX_sigfillset (&new); UX_sigprocmask (SIG_SETMASK, &new, &old); if (OS_process_any_status_change ()) - return (SELECT_PROCESS_STATUS_CHANGE); - if (pending_interrupts_p ()) - return (SELECT_INTERRUPT); - UX_sigsuspend (&old); + n = SELECT_PROCESS_STATUS_CHANGE; + else if (pending_interrupts_p ()) + n = SELECT_INTERRUPT; + else + { + UX_sigsuspend (&old); + if (OS_process_any_status_change ()) + n = SELECT_PROCESS_STATUS_CHANGE; + else + n = SELECT_INTERRUPT; + } UX_sigprocmask (SIG_SETMASK, &old, NULL); - if (OS_process_any_status_change ()) - return (SELECT_PROCESS_STATUS_CHANGE); - return (SELECT_INTERRUPT); + return (n); #else /* Wait-for-io must spin. */ return