summaryrefslogtreecommitdiff
path: root/otherlibs/unix/fchmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/fchmod.c')
-rw-r--r--otherlibs/unix/fchmod.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/otherlibs/unix/fchmod.c b/otherlibs/unix/fchmod.c
index a6e8ee9033..711097eb47 100644
--- a/otherlibs/unix/fchmod.c
+++ b/otherlibs/unix/fchmod.c
@@ -15,13 +15,18 @@
#include <sys/stat.h>
#include <fail.h>
#include <mlvalues.h>
+#include <signals.h>
#include "unixsupport.h"
#ifdef HAS_FCHMOD
CAMLprim value unix_fchmod(value fd, value perm)
{
- if (fchmod(Int_val(fd), Int_val(perm)) == -1) uerror("fchmod", Nothing);
+ int result;
+ caml_enter_blocking_section();
+ result = fchmod(Int_val(fd), Int_val(perm));
+ caml_leave_blocking_section();
+ if (result == -1) uerror("fchmod", Nothing);
return Val_unit;
}