IO: shada should respect 'fsync' option

shada_write_file() is called on exit (:quit and friends), this can be
very slow.

Note: AFAICT Vim (do_viminfo()) does not appear to fsync() viminfo.
This commit is contained in:
Justin M. Keyes 2018-04-21 00:28:53 +02:00
parent fe5f38d8bd
commit a02d22cca8
2 changed files with 2 additions and 2 deletions

View File

@ -265,7 +265,7 @@ static void process_close_event(void **argv)
if (proc->type == kProcessTypePty) {
xfree(((PtyProcess *)proc)->term_name);
}
if (proc->cb) {
if (proc->cb) { // "on_exit" for jobstart(). See channel_job_start().
proc->cb(proc, proc->status, proc->data);
}
}

View File

@ -811,7 +811,7 @@ static int open_shada_file_for_reading(const char *const fname,
/// Wrapper for closing file descriptors
static void close_file(void *cookie)
{
const int error = file_free(cookie, true);
const int error = file_free(cookie, !!p_fs);
if (error != 0) {
emsgf(_(SERR "System error while closing ShaDa file: %s"),
os_strerror(error));