[Libguestfs] [PATCH 4/9] ocaml: Replace Filename.temp_dir_name with get_temp_dir_name.

Richard W.M. Jones rjones at redhat.com
Wed Oct 4 12:56:25 UTC 2017


This was deprecated and replaced in OCaml >= 4.00.
---
 common/mlutils/unix_utils.ml  | 2 +-
 common/mlutils/unix_utils.mli | 2 +-
 sparsify/copying.ml           | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/mlutils/unix_utils.ml b/common/mlutils/unix_utils.ml
index b135bcaee..b27dfde3a 100644
--- a/common/mlutils/unix_utils.ml
+++ b/common/mlutils/unix_utils.ml
@@ -52,7 +52,7 @@ end
 module Mkdtemp = struct
   external mkdtemp : string -> string = "guestfs_int_mllib_mkdtemp"
 
-  let temp_dir ?(base_dir = Filename.temp_dir_name) prefix =
+  let temp_dir ?(base_dir = Filename.get_temp_dir_name ()) prefix =
     mkdtemp (Filename.concat base_dir (prefix ^ "XXXXXX"))
 end
 
diff --git a/common/mlutils/unix_utils.mli b/common/mlutils/unix_utils.mli
index f4f8ca578..bc632be5b 100644
--- a/common/mlutils/unix_utils.mli
+++ b/common/mlutils/unix_utils.mli
@@ -85,7 +85,7 @@ module Mkdtemp : sig
 
       The optional [~base_dir:string] changes the base directory where
       to create the new temporary directory; if not specified, the default
-      [Filename.temp_dir_name] is used. *)
+      {!Filename.get_temp_dir_name} is used. *)
 end
 
 module Realpath : sig
diff --git a/sparsify/copying.ml b/sparsify/copying.ml
index 7d004b550..8e95e7336 100644
--- a/sparsify/copying.ml
+++ b/sparsify/copying.ml
@@ -71,7 +71,7 @@ let run indisk outdisk check_tmpdir compress convert
   (* Use TMPDIR or --tmp parameter? *)
   let tmp_place =
     match tmp_param with
-    | None -> Directory Filename.temp_dir_name (* $TMPDIR or /tmp *)
+    | None -> Directory (Filename.get_temp_dir_name ()) (* $TMPDIR or /tmp *)
     | Some dir when is_directory dir -> Directory dir
     | Some dev when is_block_device dev -> Block_device dev
     | Some file when String.is_prefix file "prebuilt:" ->
-- 
2.13.2




More information about the Libguestfs mailing list