chiark / gitweb /
always use the same code for creating temporary files
[elogind.git] / src / journal / test-mmap-cache.c
index e2ffaf4723b290eaa99dd15dbb731e38974c86a0..7d03bfe9d15525cada49d31fd005c612d3f92d88 100644 (file)
@@ -22,6 +22,7 @@
 #include <stdlib.h>
 #include <sys/mman.h>
 #include <unistd.h>
+#include <fcntl.h>
 
 #include "log.h"
 #include "macro.h"
@@ -36,15 +37,15 @@ int main(int argc, char *argv[]) {
 
         assert_se(m = mmap_cache_new());
 
-        x = mkstemp(px);
+        x = mkostemp_safe(px, O_RDWR|O_CLOEXEC);
         assert(x >= 0);
         unlink(px);
 
-        y = mkstemp(py);
+        y = mkostemp_safe(py, O_RDWR|O_CLOEXEC);
         assert(y >= 0);
         unlink(py);
 
-        z = mkstemp(pz);
+        z = mkostemp_safe(pz, O_RDWR|O_CLOEXEC);
         assert(z >= 0);
         unlink(pz);