From d98f750fd8de5a0546903061e94b9bda3f68681f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 4 Oct 2006 18:58:11 +0000 Subject: * tmpnam() -> File::Temp::tempdir(). --- scripts/download-using-manifests.pl.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/download-using-manifests.pl.in') diff --git a/scripts/download-using-manifests.pl.in b/scripts/download-using-manifests.pl.in index 5dd5b817afda..c5400a901af2 100644 --- a/scripts/download-using-manifests.pl.in +++ b/scripts/download-using-manifests.pl.in @@ -2,7 +2,8 @@ use strict; use readmanifest; -use POSIX qw(tmpnam strftime); +use POSIX qw(strftime); +use File::Temp qw(tempdir); my $manifestDir = "@localstatedir@/nix/manifests"; my $logFile = "@localstatedir@/log/nix/downloads"; @@ -12,9 +13,8 @@ open LOGFILE, ">>$logFile" or die "cannot open log file $logFile"; delete $ENV{"NIX_ROOT"}; # Create a temporary directory. -my $tmpDir; -do { $tmpDir = tmpnam(); } -until mkdir $tmpDir, 0700; +my $tmpDir = tempdir("nix-download.XXXXXX", CLEANUP => 1, TMPDIR => 1) + or die "cannot create a temporary directory"; chdir $tmpDir or die "cannot change to `$tmpDir': $!"; -- cgit 1.4.1