comparison src/memfile.c @ 1033:19ed3bfbe488 v7.0.159

updated for version 7.0-159
author vimboss
date Tue, 07 Nov 2006 17:02:30 +0000
parents d4bc24e6a281
children bffbbb566d6b
comparison
equal deleted inserted replaced
1032:e6aed39f1264 1033:19ed3bfbe488
1026 page_size = mfp->mf_page_size; 1026 page_size = mfp->mf_page_size;
1027 offset = (off_t)page_size * hp->bh_bnum; 1027 offset = (off_t)page_size * hp->bh_bnum;
1028 size = page_size * hp->bh_page_count; 1028 size = page_size * hp->bh_page_count;
1029 if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset) 1029 if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
1030 { 1030 {
1031 EMSG(_("E294: Seek error in swap file read")); 1031 PERROR(_("E294: Seek error in swap file read"));
1032 return FAIL; 1032 return FAIL;
1033 } 1033 }
1034 if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size) 1034 if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size)
1035 { 1035 {
1036 EMSG(_("E295: Read error in swap file")); 1036 PERROR(_("E295: Read error in swap file"));
1037 return FAIL; 1037 return FAIL;
1038 } 1038 }
1039 return OK; 1039 return OK;
1040 } 1040 }
1041 1041
1083 hp2 = hp; 1083 hp2 = hp;
1084 1084
1085 offset = (off_t)page_size * nr; 1085 offset = (off_t)page_size * nr;
1086 if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset) 1086 if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset)
1087 { 1087 {
1088 EMSG(_("E296: Seek error in swap file write")); 1088 PERROR(_("E296: Seek error in swap file write"));
1089 return FAIL; 1089 return FAIL;
1090 } 1090 }
1091 if (hp2 == NULL) /* freed block, fill with dummy data */ 1091 if (hp2 == NULL) /* freed block, fill with dummy data */
1092 page_count = 1; 1092 page_count = 1;
1093 else 1093 else