From 291a9d15ed1eb1094edc8ad6dda00a6da3bd7072 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 25 Nov 2017 14:37:11 +0100 Subject: 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) --- src/evalfunc.c | 6 ++++-- src/version.c | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/evalfunc.c b/src/evalfunc.c index 8d288e0dc..76c576855 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -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); } diff --git a/src/version.c b/src/version.c index 408b85cd4..e0ba19e28 100644 --- a/src/version.c +++ b/src/version.c @@ -771,6 +771,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1335, /**/ 1334, /**/ -- cgit v1.2.1