fileio: imply /tmp as directory if passed as NULL to open_tmpfile_unlinkable()

We can make this smarter one day, to honour $TMPDIR and friends, but for now,
let's just use /tmp.
This commit is contained in:
Lennart Poettering 2016-07-25 20:35:04 +02:00
parent 91fe95e158
commit 87410f166e
1 changed files with 2 additions and 1 deletions

View 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 */