about summary refs log tree commit diff
path: root/scripts/download-using-manifests.pl.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-04T18·58+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-04T18·58+0000
commitd98f750fd8de5a0546903061e94b9bda3f68681f (patch)
treec689b6225fdf0160091caf39c4c4770dbf787a12 /scripts/download-using-manifests.pl.in
parent34427a7b43382215774b1a164fd784a0f7804d33 (diff)
* tmpnam() -> File::Temp::tempdir().
Diffstat (limited to 'scripts/download-using-manifests.pl.in')
-rw-r--r--scripts/download-using-manifests.pl.in8
1 files changed, 4 insertions, 4 deletions
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': $!";