summaryrefslogtreecommitdiff
path: root/otherlibs
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs')
-rw-r--r--otherlibs/graph/open.c2
-rw-r--r--otherlibs/unix/access.c2
-rw-r--r--otherlibs/unix/chdir.c2
-rw-r--r--otherlibs/unix/chmod.c2
-rw-r--r--otherlibs/unix/chown.c2
-rw-r--r--otherlibs/unix/chroot.c2
-rw-r--r--otherlibs/unix/getaddrinfo.c4
-rw-r--r--otherlibs/unix/gethost.c2
-rw-r--r--otherlibs/unix/link.c4
-rw-r--r--otherlibs/unix/mkdir.c2
-rw-r--r--otherlibs/unix/mkfifo.c4
-rw-r--r--otherlibs/unix/open.c2
-rw-r--r--otherlibs/unix/opendir.c2
-rw-r--r--otherlibs/unix/readlink.c2
-rw-r--r--otherlibs/unix/rename.c4
-rw-r--r--otherlibs/unix/rmdir.c2
-rw-r--r--otherlibs/unix/stat.c8
-rw-r--r--otherlibs/unix/symlink.c4
-rw-r--r--otherlibs/unix/truncate.c4
-rw-r--r--otherlibs/unix/unlink.c2
-rw-r--r--otherlibs/unix/utimes.c4
-rw-r--r--otherlibs/win32unix/readlink.c2
-rw-r--r--otherlibs/win32unix/stat.c2
-rw-r--r--otherlibs/win32unix/symlink.c4
24 files changed, 35 insertions, 35 deletions
diff --git a/otherlibs/graph/open.c b/otherlibs/graph/open.c
index 8f6ee07fb0..890b8713ef 100644
--- a/otherlibs/graph/open.c
+++ b/otherlibs/graph/open.c
@@ -246,7 +246,7 @@ value caml_gr_window_id(void)
value caml_gr_set_window_title(value n)
{
if (window_name != NULL) caml_stat_free(window_name);
- window_name = caml_strdup(String_val(n));
+ window_name = caml_stat_strdup(String_val(n));
if (caml_gr_initialized) {
XStoreName(caml_gr_display, caml_gr_window.win, window_name);
XSetIconName(caml_gr_display, caml_gr_window.win, window_name);
diff --git a/otherlibs/unix/access.c b/otherlibs/unix/access.c
index 0df09ed25a..b6170026a7 100644
--- a/otherlibs/unix/access.c
+++ b/otherlibs/unix/access.c
@@ -54,7 +54,7 @@ CAMLprim value unix_access(value path, value perms)
caml_unix_check_path(path, "access");
cv_flags = caml_convert_flag_list(perms, access_permission_table);
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = access(p, cv_flags);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/chdir.c b/otherlibs/unix/chdir.c
index 244ad5d3c5..c75261cdb7 100644
--- a/otherlibs/unix/chdir.c
+++ b/otherlibs/unix/chdir.c
@@ -24,7 +24,7 @@ CAMLprim value unix_chdir(value path)
char * p;
int ret;
caml_unix_check_path(path, "chdir");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = chdir(p);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/chmod.c b/otherlibs/unix/chmod.c
index cfdc1a3346..8382db5ef6 100644
--- a/otherlibs/unix/chmod.c
+++ b/otherlibs/unix/chmod.c
@@ -26,7 +26,7 @@ CAMLprim value unix_chmod(value path, value perm)
char * p;
int ret;
caml_unix_check_path(path, "chmod");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = chmod(p, Int_val(perm));
caml_leave_blocking_section();
diff --git a/otherlibs/unix/chown.c b/otherlibs/unix/chown.c
index f018e9e0a7..4b53a2c02e 100644
--- a/otherlibs/unix/chown.c
+++ b/otherlibs/unix/chown.c
@@ -24,7 +24,7 @@ CAMLprim value unix_chown(value path, value uid, value gid)
char * p;
int ret;
caml_unix_check_path(path, "chown");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = chown(p, Int_val(uid), Int_val(gid));
caml_leave_blocking_section();
diff --git a/otherlibs/unix/chroot.c b/otherlibs/unix/chroot.c
index 7b87de7223..8da7710cbd 100644
--- a/otherlibs/unix/chroot.c
+++ b/otherlibs/unix/chroot.c
@@ -24,7 +24,7 @@ CAMLprim value unix_chroot(value path)
char * p;
int ret;
caml_unix_check_path(path, "chroot");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = chroot(p);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/getaddrinfo.c b/otherlibs/unix/getaddrinfo.c
index 90c27dae9c..ab605bd275 100644
--- a/otherlibs/unix/getaddrinfo.c
+++ b/otherlibs/unix/getaddrinfo.c
@@ -71,13 +71,13 @@ CAMLprim value unix_getaddrinfo(value vnode, value vserv, value vopts)
if (caml_string_length(vnode) == 0) {
node = NULL;
} else {
- node = caml_strdup(String_val(vnode));
+ node = caml_stat_strdup(String_val(vnode));
}
/* Extract "service" parameter */
if (caml_string_length(vserv) == 0) {
serv = NULL;
} else {
- serv = caml_strdup(String_val(vserv));
+ serv = caml_stat_strdup(String_val(vserv));
}
/* Parse options, set hints */
memset(&hints, 0, sizeof(hints));
diff --git a/otherlibs/unix/gethost.c b/otherlibs/unix/gethost.c
index 1c1f5efa03..6c912e5f7b 100644
--- a/otherlibs/unix/gethost.c
+++ b/otherlibs/unix/gethost.c
@@ -136,7 +136,7 @@ CAMLprim value unix_gethostbyname(value name)
if (! caml_string_is_c_safe(name)) caml_raise_not_found();
#if HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT
- hostname = caml_strdup(String_val(name));
+ hostname = caml_stat_strdup(String_val(name));
#else
hostname = String_val(name);
#endif
diff --git a/otherlibs/unix/link.c b/otherlibs/unix/link.c
index 3179c060dc..6454aaed1a 100644
--- a/otherlibs/unix/link.c
+++ b/otherlibs/unix/link.c
@@ -26,8 +26,8 @@ CAMLprim value unix_link(value path1, value path2)
int ret;
caml_unix_check_path(path1, "link");
caml_unix_check_path(path2, "link");
- p1 = caml_strdup(String_val(path1));
- p2 = caml_strdup(String_val(path2));
+ p1 = caml_stat_strdup(String_val(path1));
+ p2 = caml_stat_strdup(String_val(path2));
caml_enter_blocking_section();
ret = link(p1, p2);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/mkdir.c b/otherlibs/unix/mkdir.c
index 93cb61cc97..0c1777816e 100644
--- a/otherlibs/unix/mkdir.c
+++ b/otherlibs/unix/mkdir.c
@@ -26,7 +26,7 @@ CAMLprim value unix_mkdir(value path, value perm)
char * p;
int ret;
caml_unix_check_path(path, "mkdir");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = mkdir(p, Int_val(perm));
caml_leave_blocking_section();
diff --git a/otherlibs/unix/mkfifo.c b/otherlibs/unix/mkfifo.c
index 4b97c1c45b..7914c877d1 100644
--- a/otherlibs/unix/mkfifo.c
+++ b/otherlibs/unix/mkfifo.c
@@ -29,7 +29,7 @@ CAMLprim value unix_mkfifo(value path, value mode)
char * p;
int ret;
caml_unix_check_path(path, "mkfifo");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = mkfifo(p, Int_val(mode));
caml_leave_blocking_section();
@@ -52,7 +52,7 @@ CAMLprim value unix_mkfifo(value path, value mode)
char * p;
int ret;
caml_unix_check_path(path, "mkfifo");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = mknod(p, (Int_val(mode) & 07777) | S_IFIFO, 0);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/open.c b/otherlibs/unix/open.c
index 1892d44c76..859dbe4467 100644
--- a/otherlibs/unix/open.c
+++ b/otherlibs/unix/open.c
@@ -73,7 +73,7 @@ CAMLprim value unix_open(value path, value flags, value perm)
#if defined(O_CLOEXEC)
if (cloexec) cv_flags |= O_CLOEXEC;
#endif
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
/* open on a named FIFO can block (PR#1533) */
caml_enter_blocking_section();
fd = open(p, cv_flags, Int_val(perm));
diff --git a/otherlibs/unix/opendir.c b/otherlibs/unix/opendir.c
index 067cacc575..ead693d352 100644
--- a/otherlibs/unix/opendir.c
+++ b/otherlibs/unix/opendir.c
@@ -33,7 +33,7 @@ CAMLprim value unix_opendir(value path)
char * p;
caml_unix_check_path(path, "opendir");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
d = opendir(p);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/readlink.c b/otherlibs/unix/readlink.c
index 4e9f04538e..05973e0eb5 100644
--- a/otherlibs/unix/readlink.c
+++ b/otherlibs/unix/readlink.c
@@ -39,7 +39,7 @@ CAMLprim value unix_readlink(value path)
int len;
char * p;
caml_unix_check_path(path, "readlink");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
len = readlink(p, buffer, sizeof(buffer) - 1);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/rename.c b/otherlibs/unix/rename.c
index bf13eab6f3..c31e028b62 100644
--- a/otherlibs/unix/rename.c
+++ b/otherlibs/unix/rename.c
@@ -27,8 +27,8 @@ CAMLprim value unix_rename(value path1, value path2)
int ret;
caml_unix_check_path(path1, "rename");
caml_unix_check_path(path2, "rename");
- p1 = caml_strdup(String_val(path1));
- p2 = caml_strdup(String_val(path2));
+ p1 = caml_stat_strdup(String_val(path1));
+ p2 = caml_stat_strdup(String_val(path2));
caml_enter_blocking_section();
ret = rename(p1, p2);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/rmdir.c b/otherlibs/unix/rmdir.c
index 9f9b4589ee..748a22bed6 100644
--- a/otherlibs/unix/rmdir.c
+++ b/otherlibs/unix/rmdir.c
@@ -24,7 +24,7 @@ CAMLprim value unix_rmdir(value path)
char * p;
int ret;
caml_unix_check_path(path, "rmdir");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = rmdir(p);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/stat.c b/otherlibs/unix/stat.c
index cd62dd0bbc..48d4a6bded 100644
--- a/otherlibs/unix/stat.c
+++ b/otherlibs/unix/stat.c
@@ -85,7 +85,7 @@ CAMLprim value unix_stat(value path)
struct stat buf;
char * p;
caml_unix_check_path(path, "stat");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = stat(p, &buf);
caml_leave_blocking_section();
@@ -103,7 +103,7 @@ CAMLprim value unix_lstat(value path)
struct stat buf;
char * p;
caml_unix_check_path(path, "lstat");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
#ifdef HAS_SYMLINK
ret = lstat(p, &buf);
@@ -138,7 +138,7 @@ CAMLprim value unix_stat_64(value path)
struct stat buf;
char * p;
caml_unix_check_path(path, "stat");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = stat(p, &buf);
caml_leave_blocking_section();
@@ -154,7 +154,7 @@ CAMLprim value unix_lstat_64(value path)
struct stat buf;
char * p;
caml_unix_check_path(path, "lstat");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
#ifdef HAS_SYMLINK
ret = lstat(p, &buf);
diff --git a/otherlibs/unix/symlink.c b/otherlibs/unix/symlink.c
index 0bff3f6d70..bbf3cfcb7a 100644
--- a/otherlibs/unix/symlink.c
+++ b/otherlibs/unix/symlink.c
@@ -29,8 +29,8 @@ CAMLprim value unix_symlink(value to_dir, value path1, value path2)
int ret;
caml_unix_check_path(path1, "symlink");
caml_unix_check_path(path2, "symlink");
- p1 = caml_strdup(String_val(path1));
- p2 = caml_strdup(String_val(path2));
+ p1 = caml_stat_strdup(String_val(path1));
+ p2 = caml_stat_strdup(String_val(path2));
caml_enter_blocking_section();
ret = symlink(p1, p2);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/truncate.c b/otherlibs/unix/truncate.c
index 4f333cbd9c..e7c1f6cb41 100644
--- a/otherlibs/unix/truncate.c
+++ b/otherlibs/unix/truncate.c
@@ -34,7 +34,7 @@ CAMLprim value unix_truncate(value path, value len)
char * p;
int ret;
caml_unix_check_path(path, "truncate");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = truncate(p, Long_val(len));
caml_leave_blocking_section();
@@ -51,7 +51,7 @@ CAMLprim value unix_truncate_64(value path, value vlen)
int ret;
file_offset len = File_offset_val(vlen);
caml_unix_check_path(path, "truncate");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = truncate(p, len);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/unlink.c b/otherlibs/unix/unlink.c
index c06dd3632a..f9223b1f85 100644
--- a/otherlibs/unix/unlink.c
+++ b/otherlibs/unix/unlink.c
@@ -24,7 +24,7 @@ CAMLprim value unix_unlink(value path)
char * p;
int ret;
caml_unix_check_path(path, "unlink");
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = unlink(p);
caml_leave_blocking_section();
diff --git a/otherlibs/unix/utimes.c b/otherlibs/unix/utimes.c
index f60fbbcecd..c77b94b0d4 100644
--- a/otherlibs/unix/utimes.c
+++ b/otherlibs/unix/utimes.c
@@ -43,7 +43,7 @@ CAMLprim value unix_utimes(value path, value atime, value mtime)
tv[1].tv_usec = (mt - tv[1].tv_sec) * 1000000;
t = tv;
}
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = utimes(p, t);
caml_leave_blocking_section();
@@ -78,7 +78,7 @@ CAMLprim value unix_utimes(value path, value atime, value mtime)
times.modtime = mt;
t = ×
}
- p = caml_strdup(String_val(path));
+ p = caml_stat_strdup(String_val(path));
caml_enter_blocking_section();
ret = utime(p, t);
caml_leave_blocking_section();
diff --git a/otherlibs/win32unix/readlink.c b/otherlibs/win32unix/readlink.c
index 7b20614cb7..80112dc51d 100644
--- a/otherlibs/win32unix/readlink.c
+++ b/otherlibs/win32unix/readlink.c
@@ -29,7 +29,7 @@ CAMLprim value unix_readlink(value opath)
char* path;
DWORD attributes;
caml_unix_check_path(opath, "readlink");
- path = caml_strdup(String_val(opath));
+ path = caml_stat_strdup(String_val(opath));
caml_enter_blocking_section();
attributes = GetFileAttributes(path);
diff --git a/otherlibs/win32unix/stat.c b/otherlibs/win32unix/stat.c
index 8f05562690..7ed2df7028 100644
--- a/otherlibs/win32unix/stat.c
+++ b/otherlibs/win32unix/stat.c
@@ -304,7 +304,7 @@ static int do_stat(int do_lstat, int use_64, char* opath, mlsize_t l, HANDLE fst
{
char* path;
int ret;
- path = caml_strdup(opath);
+ path = caml_stat_strdup(opath);
ret = safe_do_stat(do_lstat, use_64, path, l, fstat, st_ino, res);
caml_stat_free(path);
return ret;
diff --git a/otherlibs/win32unix/symlink.c b/otherlibs/win32unix/symlink.c
index 326cefcbb9..11582a27e0 100644
--- a/otherlibs/win32unix/symlink.c
+++ b/otherlibs/win32unix/symlink.c
@@ -52,8 +52,8 @@ again:
}
/* Copy source and dest outside the OCaml heap */
- source = caml_strdup(String_val(osource));
- dest = caml_strdup(String_val(odest));
+ source = caml_stat_strdup(String_val(osource));
+ dest = caml_stat_strdup(String_val(odest));
caml_enter_blocking_section();
result = pCreateSymbolicLink(dest, source, flags);