0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.1413: error when the drive of the swap file was disconnected

Problem:    Error when the drive of the swap file was disconnected.
Solution:   Try closing and re-opening the swap file. (closes #4378)
This commit is contained in:
Bram Moolenaar
2019-05-27 23:36:21 +02:00
parent 72fcf07b06
commit b58a4b938c
4 changed files with 73 additions and 45 deletions

View File

@@ -604,28 +604,30 @@ typedef struct
struct memfile
{
char_u *mf_fname; /* name of the file */
char_u *mf_ffname; /* idem, full path */
int mf_fd; /* file descriptor */
bhdr_T *mf_free_first; /* first block_hdr in free list */
bhdr_T *mf_used_first; /* mru block_hdr in used list */
bhdr_T *mf_used_last; /* lru block_hdr in used list */
unsigned mf_used_count; /* number of pages in used list */
unsigned mf_used_count_max; /* maximum number of pages in memory */
mf_hashtab_T mf_hash; /* hash lists */
mf_hashtab_T mf_trans; /* trans lists */
blocknr_T mf_blocknr_max; /* highest positive block number + 1*/
blocknr_T mf_blocknr_min; /* lowest negative block number - 1 */
blocknr_T mf_neg_count; /* number of negative blocks numbers */
blocknr_T mf_infile_count; /* number of pages in the file */
unsigned mf_page_size; /* number of bytes in a page */
int mf_dirty; /* TRUE if there are dirty blocks */
char_u *mf_fname; // name of the file
char_u *mf_ffname; // idem, full path
int mf_fd; // file descriptor
int mf_flags; // flags used when opening this memfile
int mf_reopen; // mf_fd was closed, retry opening
bhdr_T *mf_free_first; // first block_hdr in free list
bhdr_T *mf_used_first; // mru block_hdr in used list
bhdr_T *mf_used_last; // lru block_hdr in used list
unsigned mf_used_count; // number of pages in used list
unsigned mf_used_count_max; // maximum number of pages in memory
mf_hashtab_T mf_hash; // hash lists
mf_hashtab_T mf_trans; // trans lists
blocknr_T mf_blocknr_max; // highest positive block number + 1
blocknr_T mf_blocknr_min; // lowest negative block number - 1
blocknr_T mf_neg_count; // number of negative blocks numbers
blocknr_T mf_infile_count; // number of pages in the file
unsigned mf_page_size; // number of bytes in a page
int mf_dirty; // TRUE if there are dirty blocks
#ifdef FEAT_CRYPT
buf_T *mf_buffer; /* buffer this memfile is for */
char_u mf_seed[MF_SEED_LEN]; /* seed for encryption */
buf_T *mf_buffer; // buffer this memfile is for
char_u mf_seed[MF_SEED_LEN]; // seed for encryption
/* Values for key, method and seed used for reading data blocks when
* updating for a newly set key or method. Only when mf_old_key != NULL. */
// Values for key, method and seed used for reading data blocks when
// updating for a newly set key or method. Only when mf_old_key != NULL.
char_u *mf_old_key;
int mf_old_cm;
char_u mf_old_seed[MF_SEED_LEN];