0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

patch 8.0.1335: writefile() using fsync() may give an error.

Problem:    Writefile() using fsync() may give an error for a device.
            (Yasuhiro Matsumoto)
Solution:   Ignore fsync() failing. (closes #2373)
This commit is contained in:
Bram Moolenaar 2017-11-25 14:37:11 +01:00
parent 3167c3e701
commit 291a9d15ed
2 changed files with 6 additions and 2 deletions

View File

@ -13449,8 +13449,10 @@ f_writefile(typval_T *argvars, typval_T *rettv)
if (write_list(fd, list, binary) == FAIL) if (write_list(fd, list, binary) == FAIL)
ret = -1; ret = -1;
#ifdef HAVE_FSYNC #ifdef HAVE_FSYNC
else if (do_fsync && fsync(fileno(fd)) != 0) else if (do_fsync)
EMSG(_(e_fsync)); /* Ignore the error, the user wouldn't know what to do about it.
* May happen for a device. */
ignored = fsync(fileno(fd));
#endif #endif
fclose(fd); fclose(fd);
} }

View File

@ -771,6 +771,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1335,
/**/ /**/
1334, 1334,
/**/ /**/