aboutsummaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-04-23 14:29:15 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2018-04-23 14:30:26 +0200
commit8b4081a889b35cac3ccafa4f7109c72ccb087518 (patch)
treec23b86c73797cd0dbac4aa698d05957ced6c9395 /src/util.h
parente2746db66fd5b4a37ec1117de012a45ba3d8f3a5 (diff)
parentcf0277928fa8d955d75f661021845789194dfff7 (diff)
Merge #13039: Add logging and error handling for file syncing
cf02779 Add logging and error handling for file syncing (Wladimir J. van der Laan) Pull request description: Add logging and error handling inside, and outside of FileCommit. Functions such as fsync, fdatasync will return error in case of hardware I/O errors, and ignoring this means it can silently continue through data corruption. (c.f. https://lwn.net/SubscriberLink/752063/12b232ab5039efbe/) EINVAL is handled specially to avoid crashing out on (network, fuse) filesystems that don't handle `f[data]sync`. I checked that the syncing inside leveldb is already generating an I/O error as appropriate. Tree-SHA512: 64cc9bbedca3ecc97ff4bac0a7b7ac6526a7ed763c66f6786d03ca4f2e9e366e42b152cb908299c060448d98ca39ff03395280bffaca51d592e728aa2516f5dd
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index 6e742f8b91..ce94f396af 100644
--- a/src/util.h
+++ b/src/util.h
@@ -71,7 +71,7 @@ bool error(const char* fmt, const Args&... args)
}
void PrintExceptionContinue(const std::exception *pex, const char* pszThread);
-void FileCommit(FILE *file);
+bool FileCommit(FILE *file);
bool TruncateFile(FILE *file, unsigned int length);
int RaiseFileDescriptorLimit(int nMinFD);
void AllocateFileRange(FILE *file, unsigned int offset, unsigned int length);