To: vim-dev@vim.org Subject: Patch 6.4.009 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.4.009 (after 6.4.002) Problem: VMS: Updating the viminfo file fails. Solution: Avoid using fdopen(). (Zoltan Arpadffy) Files: src/ex_cmds.c *** ../vim-6.4.008/src/ex_cmds.c Tue Nov 29 19:29:15 2005 --- src/ex_cmds.c Wed Mar 15 11:27:43 2006 *************** *** 1514,1536 **** if (tempname != NULL) { int fd; /* Use mch_open() to be able to use O_EXCL 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, (int)((st_old.st_mode & 0777) | 0600)); ! #else fd = mch_open((char *)tempname, O_CREAT|O_EXTRA|O_EXCL|O_WRONLY, 0600); /* r&w for user only */ ! #endif if (fd < 0) fp_out = NULL; else fp_out = fdopen(fd, WRITEBIN); /* * If we can't create in the same directory, try creating a --- 1514,1543 ---- if (tempname != NULL) { + #ifdef VMS + /* fdopen() fails for some reason */ + 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_EXCL 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, (int)((st_old.st_mode & 0777) | 0600)); ! # else fd = mch_open((char *)tempname, O_CREAT|O_EXTRA|O_EXCL|O_WRONLY, 0600); /* r&w for user only */ ! # 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 *** ../vim-6.4.008/src/version.c Sat Feb 25 14:38:00 2006 --- src/version.c Wed Mar 15 11:23:20 2006 *************** *** 643,644 **** --- 643,646 ---- { /* Add new patch number below this line */ + /**/ + 9, /**/ -- hundred-and-one symptoms of being an internet addict: 124. You begin conversations with, "Who is your internet service provider?" /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://www.ICCF.nl ///