mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
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-
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user