Skip to content

Commit

Permalink
PR#5982: save and restore the value of errno in caml_leave_blocking_s…
Browse files Browse the repository at this point in the history
…ection

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13668 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
jeremiedimino committed May 14, 2013
1 parent d69bd84 commit 5de2108
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions byterun/signals.c
Expand Up @@ -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"
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 5de2108

Please sign in to comment.