tmpfile-util: simplify umask reset declaration

This commit is contained in:
Lennart Poettering 2019-04-30 09:28:10 +02:00
parent c1447be4d4
commit f8a8579e84
1 changed files with 1 additions and 3 deletions

View File

@ -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;