From c8c029b5b5793d3c9afef34afa53d10a910adf4e Mon Sep 17 00:00:00 2001 From: Nicolas Dorier Date: Wed, 15 Mar 2017 19:32:35 +0900 Subject: [PATCH] [LevelDB] Do no crash if filesystem can't fsync See https://github.com/bitcoin/bitcoin/pull/10000 --- util/env_posix.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/env_posix.cc b/util/env_posix.cc index ba2667864acb00..63bb4bdcd4ae00 100644 --- a/util/env_posix.cc +++ b/util/env_posix.cc @@ -231,7 +231,7 @@ class PosixWritableFile : public WritableFile { if (fd < 0) { s = IOError(dir, errno); } else { - if (fsync(fd) < 0) { + if (fsync(fd) < 0 && errno != EINVAL) { s = IOError(dir, errno); } close(fd);