summaryrefslogtreecommitdiffstats
path: root/src/basic/tmpfile-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-04-30 09:28:10 +0200
committerLennart Poettering <lennart@poettering.net>2019-05-24 15:07:55 +0200
commitf8a8579e84bf5cb33d2c331efd74ffeaf8072539 (patch)
tree88bbbffc58250eafec8556c10b0da3ad5b578945 /src/basic/tmpfile-util.c
parenttests: add simple test case for chmod_and_chown() (diff)
downloadsystemd-f8a8579e84bf5cb33d2c331efd74ffeaf8072539.tar.xz
systemd-f8a8579e84bf5cb33d2c331efd74ffeaf8072539.zip
tmpfile-util: simplify umask reset declaration
Diffstat (limited to 'src/basic/tmpfile-util.c')
-rw-r--r--src/basic/tmpfile-util.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/basic/tmpfile-util.c b/src/basic/tmpfile-util.c
index e77af7659f..5100d6a5ff 100644
--- a/src/basic/tmpfile-util.c
+++ b/src/basic/tmpfile-util.c
@@ -58,13 +58,11 @@ int fopen_temporary(const char *path, FILE **_f, char **_temp_path) {
/* This is much like mkostemp() but is subject to umask(). */
int mkostemp_safe(char *pattern) {
- _cleanup_umask_ mode_t u = 0;
+ _unused_ _cleanup_umask_ mode_t u = umask(0077);
int fd;
assert(pattern);
- u = umask(077);
-
fd = mkostemp(pattern, O_CLOEXEC);
if (fd < 0)
return -errno;