summaryrefslogtreecommitdiffstats
path: root/otherlibs/unix/open.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/unix/open.c')
-rw-r--r--otherlibs/unix/open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/otherlibs/unix/open.c b/otherlibs/unix/open.c
index c98819aab..32c332f23 100644
--- a/otherlibs/unix/open.c
+++ b/otherlibs/unix/open.c
@@ -14,6 +14,7 @@
#include <mlvalues.h>
#include <alloc.h>
#include <memory.h>
+#include <misc.h>
#include <signals.h>
#include "unixsupport.h"
#include <string.h>
@@ -62,7 +63,7 @@ CAMLprim value unix_open(value path, value flags, value perm)
char * p;
cv_flags = convert_flag_list(flags, open_flag_table);
- p = caml_stat_alloc_string(path);
+ p = caml_strdup(String_val(path));
/* open on a named FIFO can block (PR#1533) */
enter_blocking_section();
fd = open(p, cv_flags, Int_val(perm));