aboutsummaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2017-02-27 10:52:38 -0800
committerMichael Forney <mforney@mforney.org>2017-02-27 11:19:24 -0800
commit80605f5a6cdcfd1d18d12151b69973b28db8c8eb (patch)
treed13307af2df21b2822cea947f60eb47354960d7d /text.c
parente4380da4a62b43e6b0848f08fbf6162d0c0a11cd (diff)
downloadvis-80605f5a6cdcfd1d18d12151b69973b28db8c8eb.tar.gz
vis-80605f5a6cdcfd1d18d12151b69973b28db8c8eb.tar.xz
Remove unnecessary umask change in text_save_begin_inplace
POSIX says that The mkstemp() function shall use the resulting pathname to create the file, and obtain a file descriptor for it, as if by a call to: open(pathname, O_RDWR|O_CREAT|O_EXCL, S_IRUSR|S_IWUSR) So this umask change didn't do anything in practice, unless the original umask was more restrictive than 0177.
Diffstat (limited to 'text.c')
-rw-r--r--text.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/text.c b/text.c
index 5a7d907..bc599f5 100644
--- a/text.c
+++ b/text.c
@@ -937,9 +937,7 @@ static bool text_save_begin_inplace(TextSave *ctx) {
*/
size_t size = txt->block->size;
char tmpname[32] = "/tmp/vis-XXXXXX";
- mode_t mask = umask(S_IXUSR | S_IRWXG | S_IRWXO);
newfd = mkstemp(tmpname);
- umask(mask);
if (newfd == -1)
goto err;
if (unlink(tmpname) == -1)