From 77b2b96ffcc973cb070325305ce2368fb6658f4a Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 2 Nov 2016 12:25:51 +0100 Subject: [PATCH] tempfile: use /tmp for fallback-tempfiles 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 0be2efe..341f0ac 100644 --- 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; -- 2.39.2