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
master
Jérémie Dimino 2013-05-14 15:48:50 +00:00
parent d69bd84bb3
commit 5de2108817
1 changed files with 5 additions and 0 deletions

View File

@ -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 */