projects
/
pve-common.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
tempfile: use /tmp for fallback-tempfiles
[pve-common.git]
/
src
/
PVE
/
Tools.pm
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;