diff options
author | emersion <contact@emersion.fr> | 2018-06-30 12:57:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-30 12:57:48 +0100 |
commit | 167105e6069d2dd66cd2d472c2a6b67703838125 (patch) | |
tree | e6626f03fdd94c7832c4b5cb3b97e2a61cf6602e /util | |
parent | 63eb720871004219826f16e0a79a0014ac5516e4 (diff) | |
parent | 0c2a64df18f8740ab795fb2970d1954a8aac34b1 (diff) |
Merge pull request #1101 from martinetd/static-analysis
Static analysis fixes
Diffstat (limited to 'util')
-rw-r--r-- | util/os-compatibility.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/util/os-compatibility.c b/util/os-compatibility.c index bd3067d2..38333605 100644 --- a/util/os-compatibility.c +++ b/util/os-compatibility.c @@ -29,6 +29,7 @@ #include <stdlib.h> #include <string.h> #include <sys/socket.h> +#include <sys/stat.h> #include <sys/types.h> #include <unistd.h> #include "util/os-compatibility.h" @@ -61,6 +62,7 @@ int create_tmpfile_cloexec(char *tmpname) { int fd; + mode_t prev_umask = umask(0066); #ifdef HAVE_MKOSTEMP fd = mkostemp(tmpname, O_CLOEXEC); if (fd >= 0) @@ -72,6 +74,7 @@ int create_tmpfile_cloexec(char *tmpname) unlink(tmpname); } #endif + umask(prev_umask); return fd; } |