diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-04-20 11:21:08 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-04-23 14:25:28 +0200 |
commit | cf0277928fa8d955d75f661021845789194dfff7 (patch) | |
tree | da392672c936ad9f6a91c2d77c4377a22ac127d4 /src/util.h | |
parent | 8b262eb2d80bfa27ae8501078ce47bc1407e9c55 (diff) |
Add logging and error handling for file syncing
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/)
Diffstat (limited to 'src/util.h')
-rw-r--r-- | src/util.h | 2 |
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); |