summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/close.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/close.c')
-rw-r--r--otherlibs/unix/close.c7
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;
}