summaryrefslogtreecommitdiffstats
path: root/src/ex_cmds.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-03-14 23:08:30 +0000
committerBram Moolenaar <Bram@vim.org>2006-03-14 23:08:30 +0000
commit114216c4173e2821b1e0615dd7341c03e6d6d607 (patch)
tree6b60c859afb7667a86342002a70574e18472c3f2 /src/ex_cmds.c
parent34e9e2f13d87193041deb22ed99b70739a1551c6 (diff)
updated for version 7.0224v7.0224
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r--src/ex_cmds.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 37cef12a5e..e77d05aad5 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -1811,6 +1811,15 @@ write_viminfo(file, forceit)
if (tempname != NULL)
{
+#ifdef VMS
+ /* fdopen() fails for some reason */
+ if (fp_out == NULL)
+ {
+ umask_save = umask(077);
+ fp_out = mch_fopen((char *)tempname, WRITEBIN);
+ (void)umask(umask_save);
+ }
+#else
int fd;
/* Use mch_open() to be able to use O_NOFOLLOW and set file
@@ -1818,20 +1827,21 @@ write_viminfo(file, forceit)
* Unix: same as original file, but strip s-bit. Reset umask to
* avoid it getting in the way.
* Others: r&w for user only. */
-#ifdef UNIX
+# ifdef UNIX
umask_save = umask(0);
fd = mch_open((char *)tempname,
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW,
(int)((st_old.st_mode & 0777) | 0600));
(void)umask(umask_save);
-#else
+# else
fd = mch_open((char *)tempname,
O_CREAT|O_EXTRA|O_EXCL|O_WRONLY|O_NOFOLLOW, 0600);
-#endif
+# endif
if (fd < 0)
fp_out = NULL;
else
fp_out = fdopen(fd, WRITEBIN);
+#endif /* VMS */
/*
* If we can't create in the same directory, try creating a