summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-07-25 20:35:04 +0200
committerLennart Poettering <lennart@poettering.net>2016-07-25 20:35:04 +0200
commit87410f166eb5e0f06703bd82fdec2fb47afb58ef (patch)
treece08445c0c90d1900a3dfbf4882e0f5ade16fd07
parent91fe95e158405f2798997d21cb403d624e9b5578 (diff)
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.
-rw-r--r--src/basic/fileio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/basic/fileio.c b/src/basic/fileio.c
index 47ccfc39d8..f183de4999 100644
--- a/src/basic/fileio.c
+++ b/src/basic/fileio.c
@@ -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 */