summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/fchown.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/fchown.c')
-rw-r--r--otherlibs/unix/fchown.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/otherlibs/unix/fchown.c b/otherlibs/unix/fchown.c
index 574d3c42b..71e827d76 100644
--- a/otherlibs/unix/fchown.c
+++ b/otherlibs/unix/fchown.c
@@ -19,8 +19,11 @@
CAMLprim value unix_fchown(value fd, value uid, value gid)
{
- if (fchown(Int_val(fd), Int_val(uid), Int_val(gid)) == -1)
- uerror("fchown", Nothing);
+ int result;
+ caml_enter_blocking_section();
+ result = fchown(Int_val(fd), Int_val(uid), Int_val(gid));
+ caml_leave_blocking_section();
+ if (result == -1) uerror("fchown", Nothing);
return Val_unit;
}