diff options
author | Jérémie Dimino <jeremie@dimino.org> | 2013-12-23 16:24:50 +0000 |
---|---|---|
committer | Jérémie Dimino <jeremie@dimino.org> | 2013-12-23 16:24:50 +0000 |
commit | 9fd3c41247589d58458fa269debde17b3a15e63e (patch) | |
tree | f2b13c73a9f847fd1b8f9c5d2f4ad2b25ce7bbc2 /otherlibs/unix/close.c | |
parent | 61a4334e2731d2a526a74e13db425297e633ef3f (diff) |
fix #6276: release the runtime in all stubs that might block
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14384 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix/close.c')
-rw-r--r-- | otherlibs/unix/close.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/otherlibs/unix/close.c b/otherlibs/unix/close.c index 425502aac..8a56c413b 100644 --- a/otherlibs/unix/close.c +++ b/otherlibs/unix/close.c @@ -12,10 +12,15 @@ /***********************************************************************/ #include <mlvalues.h> +#include <signals.h> #include "unixsupport.h" CAMLprim value unix_close(value fd) { - if (close(Int_val(fd)) == -1) uerror("close", Nothing); + int ret; + caml_enter_blocking_section(); + ret = close(Int_val(fd)); + caml_leave_blocking_section(); + if (ret == -1) uerror("close", Nothing); return Val_unit; } |