diff --git a/common/mlutils/unix_utils.ml b/common/mlutils/unix_utils.ml index 6912282c8..57ebf879e 100644 --- a/common/mlutils/unix_utils.ml +++ b/common/mlutils/unix_utils.ml @@ -54,7 +54,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 4df72aa55..86c2be211 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 0c0b27c94..99569a075 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:" ->