From 12a909efc70af32d6421bd3b142ace47bf27caa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Tue, 24 Dec 2013 12:09:09 +0000 Subject: fix commit 14384 git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14387 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- otherlibs/unix/access.c | 2 +- otherlibs/unix/truncate.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/otherlibs/unix/access.c b/otherlibs/unix/access.c index 6e91ba66ff..9af8a6f959 100644 --- a/otherlibs/unix/access.c +++ b/otherlibs/unix/access.c @@ -49,7 +49,7 @@ CAMLprim value unix_access(value path, value perms) cv_flags = convert_flag_list(perms, access_permission_table); p = caml_stat_alloc_string(path); caml_enter_blocking_section(); - ret = access(String_val(path), cv_flags); + ret = access(p, cv_flags); caml_leave_blocking_section(); caml_stat_free(p); if (ret == -1) diff --git a/otherlibs/unix/truncate.c b/otherlibs/unix/truncate.c index 5165e21fba..c5b3a11591 100644 --- a/otherlibs/unix/truncate.c +++ b/otherlibs/unix/truncate.c @@ -39,14 +39,15 @@ CAMLprim value unix_truncate(value path, value len) CAMLreturn(Val_unit); } -CAMLprim value unix_truncate_64(value path, value len) +CAMLprim value unix_truncate_64(value path, value vlen) { - CAMLparam2(path, len); + CAMLparam2(path, vlen); char * p; int ret; + file_offset len = File_offset_val(vlen); p = caml_stat_alloc_string(path); caml_enter_blocking_section(); - ret = truncate(p, File_offset_val(len)); + ret = truncate(p, len); caml_leave_blocking_section(); caml_stat_free(p); if (ret == -1) -- cgit v1.2.1