From 5de2108817750a5df3b67aa50a964dcafcd8d15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Tue, 14 May 2013 15:48:50 +0000 Subject: [PATCH] PR#5982: save and restore the value of errno in caml_leave_blocking_section git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13668 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- byterun/signals.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/byterun/signals.c b/byterun/signals.c index e5fb64f7f775..10f452b49af0 100644 --- a/byterun/signals.c +++ b/byterun/signals.c @@ -14,6 +14,7 @@ /* Signal handling, code common to the bytecode and native systems */ #include +#include #include "alloc.h" #include "callback.h" #include "config.h" @@ -115,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 */