diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-07-04 16:48:32 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-12-04 10:59:30 +0100 |
commit | 7a509acc297ae39ae4d54637953e598c72ad8036 (patch) | |
tree | cb93ffe6146e2668f0baf25c09ecf528f0348687 | |
parent | e5ea9ed030788de9e6be108dfc278ff14f3ddf30 (diff) | |
download | systemd-7a509acc297ae39ae4d54637953e598c72ad8036.tar.gz |
tmpfile-util: modernize mkostemp_safe() a bit
-rw-r--r-- | src/basic/tmpfile-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/tmpfile-util.c b/src/basic/tmpfile-util.c index 89fae1c453..2d201e1a57 100644 --- a/src/basic/tmpfile-util.c +++ b/src/basic/tmpfile-util.c @@ -67,12 +67,12 @@ int fopen_temporary(const char *path, FILE **ret_f, char **ret_temp_path) { /* This is much like mkostemp() but is subject to umask(). */ int mkostemp_safe(char *pattern) { - _unused_ _cleanup_umask_ mode_t u = umask(0077); int fd; assert(pattern); - fd = mkostemp(pattern, O_CLOEXEC); + RUN_WITH_UMASK(0077) + fd = mkostemp(pattern, O_CLOEXEC); if (fd < 0) return -errno; |