summaryrefslogtreecommitdiff
path: root/src/journal/test-compress.c
diff options
context:
space:
mode:
authorTopi Miettinen <topimiettinen@users.noreply.github.com>2016-09-13 06:20:38 +0000
committerMartin Pitt <martin.pitt@ubuntu.com>2016-09-13 08:20:38 +0200
commit646853bdd8b1337204643aa014ff3f1f49d91a4f (patch)
treeaaeea183f1648a27916dc36f7c0e4468f6039faf /src/journal/test-compress.c
parentacb986015d9def3dd65a99ea4f0f893af44c6fc3 (diff)
fileio: simplify mkostemp_safe() (#4090)
According to its manual page, flags given to mkostemp(3) shouldn't include O_RDWR, O_CREAT or O_EXCL flags as these are always included. Beyond those, the only flag that all callers (except a few tests where it probably doesn't matter) use is O_CLOEXEC, so set that unconditionally.
Diffstat (limited to 'src/journal/test-compress.c')
-rw-r--r--src/journal/test-compress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/journal/test-compress.c b/src/journal/test-compress.c
index 68c9a4d76c..00e5222a1c 100644
--- a/src/journal/test-compress.c
+++ b/src/journal/test-compress.c
@@ -167,7 +167,7 @@ static void test_compress_stream(int compression,
log_debug("/* test compression */");
- assert_se((dst = mkostemp_safe(pattern, O_RDWR|O_CLOEXEC)) >= 0);
+ assert_se((dst = mkostemp_safe(pattern)) >= 0);
assert_se(compress(src, dst, -1) == 0);
@@ -178,7 +178,7 @@ static void test_compress_stream(int compression,
log_debug("/* test decompression */");
- assert_se((dst2 = mkostemp_safe(pattern2, O_RDWR|O_CLOEXEC)) >= 0);
+ assert_se((dst2 = mkostemp_safe(pattern2)) >= 0);
assert_se(stat(srcfile, &st) == 0);