summaryrefslogtreecommitdiff
path: root/src/journal/test-mmap-cache.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-mmap-cache.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-mmap-cache.c')
-rw-r--r--src/journal/test-mmap-cache.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c
index 009aabf55e..0ad49aeb5f 100644
--- a/src/journal/test-mmap-cache.c
+++ b/src/journal/test-mmap-cache.c
@@ -36,15 +36,15 @@ int main(int argc, char *argv[]) {
assert_se(m = mmap_cache_new());
- x = mkostemp_safe(px, O_RDWR|O_CLOEXEC);
+ x = mkostemp_safe(px);
assert_se(x >= 0);
unlink(px);
- y = mkostemp_safe(py, O_RDWR|O_CLOEXEC);
+ y = mkostemp_safe(py);
assert_se(y >= 0);
unlink(py);
- z = mkostemp_safe(pz, O_RDWR|O_CLOEXEC);
+ z = mkostemp_safe(pz);
assert_se(z >= 0);
unlink(pz);