diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2014-03-31 17:58:53 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2014-03-31 17:58:53 +0000 |
commit | 8643356b8542e0dcab358716f1e04d47b08b1a6d (patch) | |
tree | e10cc5a03f7ead69a2d4ed563cbd021df5770ef2 /otherlibs/unix/closedir.c | |
parent | cd1bf4b9fc898cee2f4886ed18ddf6271ec522e8 (diff) | |
parent | 989ac0b2635443b9c0f183ee6343b663c854f4ea (diff) | |
download | ocaml-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/closedir.c')
-rw-r--r-- | otherlibs/unix/closedir.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/otherlibs/unix/closedir.c b/otherlibs/unix/closedir.c index ba9e743754..4196acd4e1 100644 --- a/otherlibs/unix/closedir.c +++ b/otherlibs/unix/closedir.c @@ -12,6 +12,8 @@ /***********************************************************************/ #include <mlvalues.h> +#include <memory.h> +#include <signals.h> #include "unixsupport.h" #include <errno.h> #include <sys/types.h> @@ -23,9 +25,12 @@ CAMLprim value unix_closedir(value vd) { + CAMLparam1(vd); DIR * d = DIR_Val(vd); if (d == (DIR *) NULL) unix_error(EBADF, "closedir", Nothing); + caml_enter_blocking_section(); closedir(d); + caml_leave_blocking_section(); DIR_Val(vd) = (DIR *) NULL; - return Val_unit; + CAMLreturn(Val_unit); } |