chiark / gitweb /
fileio: imply /tmp as directory if passed as NULL to open_tmpfile_unlinkable()
[elogind.git] / src / basic / fileio.c
index 525cca73899c8b42331252302425cc4d595f04ea..42de50dcf628b0c3473ab940f90f33a786b96dea 100644 (file)
@@ -1264,7 +1264,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 */