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/test/test-tmpfiles.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/test/test-tmpfiles.c')
-rw-r--r-- | src/test/test-tmpfiles.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-tmpfiles.c b/src/test/test-tmpfiles.c index f25a0dca52..565f0f8b40 100644 --- a/src/test/test-tmpfiles.c +++ b/src/test/test-tmpfiles.c @@ -34,13 +34,13 @@ int main(int argc, char** argv) { _cleanup_close_ int fd, fd2; _cleanup_free_ char *cmd, *cmd2; - fd = open_tmpfile(p, O_RDWR); + fd = open_tmpfile(p, O_RDWR|O_CLOEXEC); assert(fd >= 0); assert_se(asprintf(&cmd, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd) > 0); system(cmd); - fd2 = mkostemp_safe(pattern, O_RDWR); + fd2 = mkostemp_safe(pattern, O_RDWR|O_CLOEXEC); assert(fd >= 0); assert_se(unlink(pattern) == 0); |