aboutsummaryrefslogtreecommitdiff
path: root/src/flatfile.cpp
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-01-11 18:47:54 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-03-11 13:49:25 +0100
commitfa1d62434843866d242bff9f9c55cb838a4f0d83 (patch)
tree4e3700eee74471773d83528593a6c0a68525544a /src/flatfile.cpp
parentfa9a5e80ab86c997102a1c3d4ba017bbe86641d5 (diff)
downloadbitcoin-fa1d62434843866d242bff9f9c55cb838a4f0d83.tar.xz
scripted-diff: return error(...); ==> error(...); return false;
This is needed for the next commit. -BEGIN VERIFY SCRIPT- # Separate sed invocations to replace one-line, and two-line error(...) calls sed -i --regexp-extended 's!( +)return (error\(.*\);)!\1\2\n\1return false;!g' $( git grep -l 'return error(' ) sed -i --null-data --regexp-extended 's!( +)return (error\([^\n]*\n[^\n]*\);)!\1\2\n\1return false;!g' $( git grep -l 'return error(' ) -END VERIFY SCRIPT-
Diffstat (limited to 'src/flatfile.cpp')
-rw-r--r--src/flatfile.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/flatfile.cpp b/src/flatfile.cpp
index 59861a08ad..a040e0a484 100644
--- a/src/flatfile.cpp
+++ b/src/flatfile.cpp
@@ -82,15 +82,18 @@ bool FlatFileSeq::Flush(const FlatFilePos& pos, bool finalize)
{
FILE* file = Open(FlatFilePos(pos.nFile, 0)); // Avoid fseek to nPos
if (!file) {
- return error("%s: failed to open file %d", __func__, pos.nFile);
+ error("%s: failed to open file %d", __func__, pos.nFile);
+ return false;
}
if (finalize && !TruncateFile(file, pos.nPos)) {
fclose(file);
- return error("%s: failed to truncate file %d", __func__, pos.nFile);
+ error("%s: failed to truncate file %d", __func__, pos.nFile);
+ return false;
}
if (!FileCommit(file)) {
fclose(file);
- return error("%s: failed to commit file %d", __func__, pos.nFile);
+ error("%s: failed to commit file %d", __func__, pos.nFile);
+ return false;
}
DirectoryCommit(m_dir);