tmpfile-util: simplify umask reset declaration
This commit is contained in:
parent
c1447be4d4
commit
f8a8579e84
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue