Permalink
Browse files

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)
  • Loading branch information...
brammool committed Nov 25, 2017
1 parent 3167c3e commit 291a9d15ed1eb1094edc8ad6dda00a6da3bd7072
Showing with 6 additions and 2 deletions.
  1. +4 −2 src/evalfunc.c
  2. +2 −0 src/version.c
View
@@ -13449,8 +13449,10 @@ f_writefile(typval_T *argvars, typval_T *rettv)
if (write_list(fd, list, binary) == FAIL)
ret = -1;
#ifdef HAVE_FSYNC
else if (do_fsync && fsync(fileno(fd)) != 0)
EMSG(_(e_fsync));
else if (do_fsync)
/* Ignore the error, the user wouldn't know what to do about it.
* May happen for a device. */
ignored = fsync(fileno(fd));
#endif
fclose(fd);
}
View
@@ -771,6 +771,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1335,
/**/
1334,
/**/

0 comments on commit 291a9d1

Please sign in to comment.