Skip to content

Commit 291a9d1

Browse files
committed
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)
1 parent 3167c3e commit 291a9d1

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/evalfunc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13449,8 +13449,10 @@ f_writefile(typval_T *argvars, typval_T *rettv)
1344913449
if (write_list(fd, list, binary) == FAIL)
1345013450
ret = -1;
1345113451
#ifdef HAVE_FSYNC
13452-
else if (do_fsync && fsync(fileno(fd)) != 0)
13453-
EMSG(_(e_fsync));
13452+
else if (do_fsync)
13453+
/* Ignore the error, the user wouldn't know what to do about it.
13454+
* May happen for a device. */
13455+
ignored = fsync(fileno(fd));
1345413456
#endif
1345513457
fclose(fd);
1345613458
}

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1335,
774776
/**/
775777
1334,
776778
/**/

0 commit comments

Comments
 (0)