diff options
author | Jérémie Dimino <jeremie@dimino.org> | 2013-05-14 15:48:50 +0000 |
---|---|---|
committer | Jérémie Dimino <jeremie@dimino.org> | 2013-05-14 15:48:50 +0000 |
commit | 5de2108817750a5df3b67aa50a964dcafcd8d15b (patch) | |
tree | 2c433ab05f6a07ffc13a64a2fa4af9cd5ab3111a | |
parent | d69bd84bb38d29795f95960afffd4bdf0d1bd723 (diff) |
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
-rw-r--r-- | byterun/signals.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/byterun/signals.c b/byterun/signals.c index e5fb64f7f..10f452b49 100644 --- a/byterun/signals.c +++ b/byterun/signals.c @@ -14,6 +14,7 @@ /* 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" @@ -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 */ |