From 51c1dba88a62e3f1a1de3fc27a158a6d48bd379b Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Fri, 3 Dec 2010 15:17:35 +0100 Subject: [PATCH] ASYNC_TICK after catching EINTR in SCM_SYSCALL * libguile/_scm.h (SCM_SYSCALL): As in scm_syserror, do a SCM_ASYNC_TICK before resuming the syscall after an EINTR. --- libguile/_scm.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/libguile/_scm.h b/libguile/_scm.h index eb3a8a2e0..5421116e4 100644 --- a/libguile/_scm.h +++ b/libguile/_scm.h @@ -87,12 +87,24 @@ #include "libguile/inline.h" #include "libguile/strings.h" +/* ASYNC_TICK after finding EINTR in order to handle pending signals, if + any. See comment in scm_syserror. */ #ifndef SCM_SYSCALL #ifdef vms # ifndef __GNUC__ # include -# define SCM_SYSCALL(line) do{errno = 0;line;} \ - while(EVMSERR==errno && (vaxc$errno>>3)==(SS$_CONTROLC>>3)) +# define SCM_SYSCALL(line) \ + do \ + { \ + errno = 0; \ + line; \ + if (EVMSERR==errno && (vaxc$errno>>3)==(SS$_CONTROLC>>3)) \ + { \ + SCM_ASYNC_TICK; \ + continue; \ + } \ + } \ + while(0) # endif /* ndef __GNUC__ */ #endif /* def vms */ #endif /* ndef SCM_SYSCALL */ @@ -100,7 +112,18 @@ #ifndef SCM_SYSCALL # ifdef EINTR # if (EINTR > 0) -# define SCM_SYSCALL(line) do{errno = 0;line;}while(EINTR==errno) +# define SCM_SYSCALL(line) \ + do \ + { \ + errno = 0; \ + line; \ + if (errno == EINTR) \ + { \ + SCM_ASYNC_TICK; \ + continue; \ + } \ + } \ + while(0) # endif /* (EINTR > 0) */ # endif /* def EINTR */ #endif /* ndef SCM_SYSCALL */