From 4f46a425d4bf8b579e2d040b6b1f017c534d50ca Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 3 Oct 2017 22:24:03 +0100 Subject: [PATCH] ocaml: Replace Filename.temp_dir_name with get_temp_dir_name. 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 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:" ->