diff options
author | Ruediger Meier | 2016-02-27 13:28:04 +0100 |
---|---|---|
committer | Ruediger Meier | 2016-02-29 13:05:18 +0100 |
commit | 4d751c008e7c893c30eb7c9b04b21756ca806b67 (patch) | |
tree | 8846e5af43e5252f8b60c4c90b5ce7d174ed4d13 /libblkid/src/save.c | |
parent | build-sys: chrt requires a sched_set* function (diff) | |
download | kernel-qcow2-util-linux-4d751c008e7c893c30eb7c9b04b21756ca806b67.tar.gz kernel-qcow2-util-linux-4d751c008e7c893c30eb7c9b04b21756ca806b67.tar.xz kernel-qcow2-util-linux-4d751c008e7c893c30eb7c9b04b21756ca806b67.zip |
lib: provide fallback if mkostemp(3) missing
It's missing on OSX.
CC: Yuriy M. Kaminskiy <yumkam@gmail.com>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'libblkid/src/save.c')
-rw-r--r-- | libblkid/src/save.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libblkid/src/save.c b/libblkid/src/save.c index 5e8bbee8f..307053094 100644 --- a/libblkid/src/save.c +++ b/libblkid/src/save.c @@ -23,6 +23,7 @@ #endif #include "closestream.h" +#include "fileutils.h" #include "blkidP.h" @@ -133,7 +134,7 @@ int blkid_flush_cache(blkid_cache cache) tmp = malloc(strlen(filename) + 8); if (tmp) { sprintf(tmp, "%s-XXXXXX", filename); - fd = mkostemp(tmp, O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC); + fd = mkstemp_cloexec(tmp); if (fd >= 0) { if (fchmod(fd, 0644) != 0) DBG(SAVE, ul_debug("%s: fchmod failed", filename)); |