diff options
Diffstat (limited to 'byterun/signals.c')
-rw-r--r-- | byterun/signals.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/byterun/signals.c b/byterun/signals.c index 762884c09a..10f452b49a 100644 --- a/byterun/signals.c +++ b/byterun/signals.c @@ -11,11 +11,10 @@ /* */ /***********************************************************************/ -/* $Id: signals.c 12858 2012-08-10 14:45:51Z maranget $ */ - /* Signal handling, code common to the bytecode and native systems */ #include <signal.h> +#include <errno.h> #include "alloc.h" #include "callback.h" #include "config.h" @@ -117,8 +116,12 @@ CAMLexport void caml_enter_blocking_section(void) CAMLexport void caml_leave_blocking_section(void) { + int saved_errno; + /* Save the value of errno (PR#5982). */ + saved_errno = errno; caml_leave_blocking_section_hook (); caml_process_pending_signals(); + errno = saved_errno; } /* Execute a signal handler immediately */ |