From: Lennart Poettering Date: Mon, 25 Jul 2016 18:35:04 +0000 (+0200) Subject: fileio: imply /tmp as directory if passed as NULL to open_tmpfile_unlinkable() X-Git-Tag: v231.3~59 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3835ce8528f80dc21606c6c01b90423ba317289b;p=elogind.git 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. --- diff --git a/src/basic/fileio.c b/src/basic/fileio.c index 525cca738..42de50dcf 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -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 */