diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-01-28 13:47:35 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-01-28 13:47:35 +0100 |
commit | 2d5bdf5bc0e4714d42e5999a4e37553a6bf83575 (patch) | |
tree | ea5e964d2761f1dcd29ba9bb53b869569a6292bf /src/journal/test-mmap-cache.c | |
parent | 7736202ce9149942e96e525c08d508daa448aff5 (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.c | 7 |
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); |