summaryrefslogtreecommitdiff
path: root/otherlibs/unix/fchmod.c
diff options
context:
space:
mode:
authorDamien Doligez <damien.doligez-inria.fr>2014-03-31 17:58:53 +0000
committerDamien Doligez <damien.doligez-inria.fr>2014-03-31 17:58:53 +0000
commit8643356b8542e0dcab358716f1e04d47b08b1a6d (patch)
treee10cc5a03f7ead69a2d4ed563cbd021df5770ef2 /otherlibs/unix/fchmod.c
parentcd1bf4b9fc898cee2f4886ed18ddf6271ec522e8 (diff)
parent989ac0b2635443b9c0f183ee6343b663c854f4ea (diff)
downloadocaml-ephemeron.tar.gz
merge with trunk at rev 14512ephemeron
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/ephemeron@14514 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
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;
}