]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
fileio: imply /tmp as directory if passed as NULL to open_tmpfile_unlinkable()
authorLennart Poettering <lennart@poettering.net>
Mon, 25 Jul 2016 18:35:04 +0000 (20:35 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 25 Jul 2016 18:35:04 +0000 (20:35 +0200)
We can make this smarter one day, to honour $TMPDIR and friends, but for now,
let's just use /tmp.

src/basic/fileio.c

index 47ccfc39d8f74aebc9ff40f77b2cdb23bf4112c7..f183de49992d462ccababcef52b8ac490aa7a15d 100644 (file)
@@ -1259,7 +1259,8 @@ int open_tmpfile_unlinkable(const char *directory, int flags) {
         char *p;
         int fd;
 
-        assert(directory);
+        if (!directory)
+                directory = "/tmp";
 
         /* Returns an unlinked temporary file that cannot be linked into the file system anymore */