Karsten Hopp 1afe4d
To: vim-dev@vim.org
Karsten Hopp 1afe4d
Subject: Patch 7.0.159
Karsten Hopp 1afe4d
Fcc: outbox
Karsten Hopp 1afe4d
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 1afe4d
Mime-Version: 1.0
Karsten Hopp 1afe4d
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 1afe4d
Content-Transfer-Encoding: 8bit
Karsten Hopp 1afe4d
------------
Karsten Hopp 1afe4d
Karsten Hopp 1afe4d
Patch 7.0.159
Karsten Hopp 1afe4d
Problem:    When there is an I/O error in the swap file the cause of the error
Karsten Hopp 1afe4d
	    cannot be seen.
Karsten Hopp 1afe4d
Solution:   Use PERROR() instead of EMSG() where possible.
Karsten Hopp 1afe4d
Files:	    src/memfile.c
Karsten Hopp 1afe4d
Karsten Hopp 1afe4d
Karsten Hopp 1afe4d
*** ../vim-7.0.158/src/memfile.c	Wed Nov  1 18:10:36 2006
Karsten Hopp 1afe4d
--- src/memfile.c	Wed Nov  1 21:38:59 2006
Karsten Hopp 1afe4d
***************
Karsten Hopp 1afe4d
*** 1028,1039 ****
Karsten Hopp 1afe4d
      size = page_size * hp->bh_page_count;
Karsten Hopp 1afe4d
      if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
Karsten Hopp 1afe4d
      {
Karsten Hopp 1afe4d
! 	EMSG(_("E294: Seek error in swap file read"));
Karsten Hopp 1afe4d
  	return FAIL;
Karsten Hopp 1afe4d
      }
Karsten Hopp 1afe4d
      if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size)
Karsten Hopp 1afe4d
      {
Karsten Hopp 1afe4d
! 	EMSG(_("E295: Read error in swap file"));
Karsten Hopp 1afe4d
  	return FAIL;
Karsten Hopp 1afe4d
      }
Karsten Hopp 1afe4d
      return OK;
Karsten Hopp 1afe4d
--- 1028,1039 ----
Karsten Hopp 1afe4d
      size = page_size * hp->bh_page_count;
Karsten Hopp 1afe4d
      if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
Karsten Hopp 1afe4d
      {
Karsten Hopp 1afe4d
! 	PERROR(_("E294: Seek error in swap file read"));
Karsten Hopp 1afe4d
  	return FAIL;
Karsten Hopp 1afe4d
      }
Karsten Hopp 1afe4d
      if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size)
Karsten Hopp 1afe4d
      {
Karsten Hopp 1afe4d
! 	PERROR(_("E295: Read error in swap file"));
Karsten Hopp 1afe4d
  	return FAIL;
Karsten Hopp 1afe4d
      }
Karsten Hopp 1afe4d
      return OK;
Karsten Hopp 1afe4d
***************
Karsten Hopp 1afe4d
*** 1085,1091 ****
Karsten Hopp 1afe4d
  	offset = (off_t)page_size * nr;
Karsten Hopp 1afe4d
  	if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
Karsten Hopp 1afe4d
  	{
Karsten Hopp 1afe4d
! 	    EMSG(_("E296: Seek error in swap file write"));
Karsten Hopp 1afe4d
  	    return FAIL;
Karsten Hopp 1afe4d
  	}
Karsten Hopp 1afe4d
  	if (hp2 == NULL)	    /* freed block, fill with dummy data */
Karsten Hopp 1afe4d
--- 1085,1091 ----
Karsten Hopp 1afe4d
  	offset = (off_t)page_size * nr;
Karsten Hopp 1afe4d
  	if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
Karsten Hopp 1afe4d
  	{
Karsten Hopp 1afe4d
! 	    PERROR(_("E296: Seek error in swap file write"));
Karsten Hopp 1afe4d
  	    return FAIL;
Karsten Hopp 1afe4d
  	}
Karsten Hopp 1afe4d
  	if (hp2 == NULL)	    /* freed block, fill with dummy data */
Karsten Hopp 1afe4d
*** ../vim-7.0.158/src/version.c	Wed Nov  1 21:24:58 2006
Karsten Hopp 1afe4d
--- src/version.c	Tue Nov  7 17:58:58 2006
Karsten Hopp 1afe4d
***************
Karsten Hopp 1afe4d
*** 668,669 ****
Karsten Hopp 1afe4d
--- 668,671 ----
Karsten Hopp 1afe4d
  {   /* Add new patch number below this line */
Karsten Hopp 1afe4d
+ /**/
Karsten Hopp 1afe4d
+     159,
Karsten Hopp 1afe4d
  /**/
Karsten Hopp 1afe4d
Karsten Hopp 1afe4d
-- 
Karsten Hopp 1afe4d
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 1afe4d
171. You invent another person and chat with yourself in empty chat rooms.
Karsten Hopp 1afe4d
Karsten Hopp 1afe4d
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 1afe4d
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 1afe4d
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 1afe4d
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///