summaryrefslogtreecommitdiff
path: root/otherlibs/unix/readdir.c
diff options
context:
space:
mode:
authorJérémie Dimino <jeremie@dimino.org>2013-12-23 16:24:50 +0000
committerJérémie Dimino <jeremie@dimino.org>2013-12-23 16:24:50 +0000
commit9fd3c41247589d58458fa269debde17b3a15e63e (patch)
treef2b13c73a9f847fd1b8f9c5d2f4ad2b25ce7bbc2 /otherlibs/unix/readdir.c
parent61a4334e2731d2a526a74e13db425297e633ef3f (diff)
downloadocaml-9fd3c41247589d58458fa269debde17b3a15e63e.tar.gz
fix #6276: release the runtime in all stubs that might block
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14384 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/unix/readdir.c')
-rw-r--r--otherlibs/unix/readdir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/otherlibs/unix/readdir.c b/otherlibs/unix/readdir.c
index 08dad1a06d..e6daf5f61c 100644
--- a/otherlibs/unix/readdir.c
+++ b/otherlibs/unix/readdir.c
@@ -14,6 +14,7 @@
#include <mlvalues.h>
#include <fail.h>
#include <alloc.h>
+#include <signals.h>
#include "unixsupport.h"
#include <errno.h>
#include <sys/types.h>
@@ -31,7 +32,9 @@ CAMLprim value unix_readdir(value vd)
directory_entry * e;
d = DIR_Val(vd);
if (d == (DIR *) NULL) unix_error(EBADF, "readdir", Nothing);
+ caml_enter_blocking_section();
e = readdir((DIR *) d);
+ caml_leave_blocking_section();
if (e == (directory_entry *) NULL) raise_end_of_file();
return copy_string(e->d_name);
}