home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.4 / 6.4.009 < prev    next >
Encoding:
Internet Message Format  |  2006-03-14  |  2.6 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.4.009
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.4.009 (after 6.4.002)
  11. Problem:    VMS: Updating the viminfo file fails.
  12. Solution:   Avoid using fdopen(). (Zoltan Arpadffy)
  13. Files:        src/ex_cmds.c
  14.  
  15.  
  16. *** ../vim-6.4.008/src/ex_cmds.c    Tue Nov 29 19:29:15 2005
  17. --- src/ex_cmds.c    Wed Mar 15 11:27:43 2006
  18. ***************
  19. *** 1514,1536 ****
  20.   
  21.       if (tempname != NULL)
  22.       {
  23.           int fd;
  24.   
  25.           /* Use mch_open() to be able to use O_EXCL and set file
  26.            * protection same as original file, but strip s-bit. */
  27. ! #ifdef UNIX
  28.           fd = mch_open((char *)tempname,
  29.               O_CREAT|O_EXTRA|O_EXCL|O_WRONLY,
  30.                          (int)((st_old.st_mode & 0777) | 0600));
  31. ! #else
  32.           fd = mch_open((char *)tempname,
  33.               O_CREAT|O_EXTRA|O_EXCL|O_WRONLY,
  34.                          0600);    /* r&w for user only */
  35. ! #endif
  36.           if (fd < 0)
  37.           fp_out = NULL;
  38.           else
  39.           fp_out = fdopen(fd, WRITEBIN);
  40.   
  41.           /*
  42.            * If we can't create in the same directory, try creating a
  43. --- 1514,1543 ----
  44.   
  45.       if (tempname != NULL)
  46.       {
  47. + #ifdef VMS
  48. +         /* fdopen() fails for some reason */
  49. +         umask_save = umask(077);
  50. +         fp_out = mch_fopen((char *)tempname, WRITEBIN);
  51. +         (void)umask(umask_save);
  52. + #else
  53.           int fd;
  54.   
  55.           /* Use mch_open() to be able to use O_EXCL and set file
  56.            * protection same as original file, but strip s-bit. */
  57. ! # ifdef UNIX
  58.           fd = mch_open((char *)tempname,
  59.               O_CREAT|O_EXTRA|O_EXCL|O_WRONLY,
  60.                          (int)((st_old.st_mode & 0777) | 0600));
  61. ! # else
  62.           fd = mch_open((char *)tempname,
  63.               O_CREAT|O_EXTRA|O_EXCL|O_WRONLY,
  64.                          0600);    /* r&w for user only */
  65. ! # endif
  66.           if (fd < 0)
  67.           fp_out = NULL;
  68.           else
  69.           fp_out = fdopen(fd, WRITEBIN);
  70. + #endif /* VMS */
  71.   
  72.           /*
  73.            * If we can't create in the same directory, try creating a
  74. *** ../vim-6.4.008/src/version.c    Sat Feb 25 14:38:00 2006
  75. --- src/version.c    Wed Mar 15 11:23:20 2006
  76. ***************
  77. *** 643,644 ****
  78. --- 643,646 ----
  79.   {   /* Add new patch number below this line */
  80. + /**/
  81. +     9,
  82.   /**/
  83.  
  84. -- 
  85. hundred-and-one symptoms of being an internet addict:
  86. 124. You begin conversations with, "Who is your internet service provider?"
  87.  
  88.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  89. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  90. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  91.  \\\            help me help AIDS victims -- http://www.ICCF.nl         ///
  92.