summaryrefslogtreecommitdiff
path: root/src/journal/test-mmap-cache.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-01-28 13:47:35 +0100
committerLennart Poettering <lennart@poettering.net>2014-01-28 13:47:35 +0100
commit2d5bdf5bc0e4714d42e5999a4e37553a6bf83575 (patch)
treeea5e964d2761f1dcd29ba9bb53b869569a6292bf /src/journal/test-mmap-cache.c
parent7736202ce9149942e96e525c08d508daa448aff5 (diff)
always use the same code for creating temporary files
Let's unify our code here, and also always specifiy O_CLOEXEC.
Diffstat (limited to 'src/journal/test-mmap-cache.c')
-rw-r--r--src/journal/test-mmap-cache.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c
index e2ffaf4723..7d03bfe9d1 100644
--- a/src/journal/test-mmap-cache.c
+++ b/src/journal/test-mmap-cache.c
@@ -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);