projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
7e1ee74
)
tempfile: use /tmp for fallback-tempfiles
author
Wolfgang Bumiller
<w.bumiller@proxmox.com>
Wed, 2 Nov 2016 11:25:51 +0000
(12:25 +0100)
committer
Dietmar Maurer
<dietmar@proxmox.com>
Wed, 2 Nov 2016 11:47:05 +0000
(12:47 +0100)
At this point we know it's not a tmpfs (as tmpfs definitely
supports O_TMPFILE), so /tmp makes more sense than /run as
default path.
src/PVE/Tools.pm
patch
|
blob
|
blame
|
history
diff --git
a/src/PVE/Tools.pm
b/src/PVE/Tools.pm
index 0be2efee70feb9e34fa8c582ec23ea73a268d307..341f0ac1cdc63c4d18d05e9da011c13e5c927dd7 100644
(file)
--- a/
src/PVE/Tools.pm
+++ b/
src/PVE/Tools.pm
@@
-1310,6
+1310,7
@@
sub tempfile {
my $fh = IO::File->new($dir, $mode | O_TMPFILE, $perm);
if (!$fh && $! == EOPNOTSUPP) {
+ $dir = '/tmp' if !defined($opts{dir});
$dir .= "/.tmpfile.$$";
$fh = IO::File->new($dir, $mode | O_CREAT | O_EXCL, $perm);
unlink($dir) if $fh;