summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ex_cmds.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 378fe92b20..b6fab2c14f 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1804,14 +1804,15 @@ write_viminfo(file, forceit)
/* Use mch_open() to be able to use O_NOFOLLOW and set file
* protection same as original file, but strip s-bit. */
+#ifdef UNIX
fd = mch_open((char *)tempname,
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW,
-#ifdef UNIX
- (int)((st_old.st_mode & 0777) | 0600)
+ (int)((st_old.st_mode & 0777) | 0600));
#else
- 0600 /* r&w for user only */
+ fd = mch_open((char *)tempname,
+ O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW,
+ 0600); /* r&w for user only */
#endif
- );
if (fd < 0)
fp_out = NULL;
else