1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-16 02:01:59 +02:00

* tmpnam() -> File::Temp::tempdir().

This commit is contained in:
Eelco Dolstra 2006-10-04 18:58:11 +00:00
parent 34427a7b43
commit d98f750fd8
7 changed files with 41 additions and 53 deletions

View file

@ -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': $!";