From fad0335517096f435d76adce7833e213d3cc23d1 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 11 Jan 2024 19:43:27 +0100 Subject: scripted-diff: Replace error() with LogError() This fixes the log output when -logsourcelocations is used. Also, instead of 'ERROR:', the log will now say '[error]', like other errors logged with LogError. -BEGIN VERIFY SCRIPT- sed -i --regexp-extended 's! error\("([^"]+)"! LogError("\1\\n"!g' $( git grep -l ' error(' ./src/ ) -END VERIFY SCRIPT- --- src/flatfile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/flatfile.cpp') diff --git a/src/flatfile.cpp b/src/flatfile.cpp index a040e0a484..2bff663d8b 100644 --- a/src/flatfile.cpp +++ b/src/flatfile.cpp @@ -82,17 +82,17 @@ bool FlatFileSeq::Flush(const FlatFilePos& pos, bool finalize) { FILE* file = Open(FlatFilePos(pos.nFile, 0)); // Avoid fseek to nPos if (!file) { - error("%s: failed to open file %d", __func__, pos.nFile); + LogError("%s: failed to open file %d\n", __func__, pos.nFile); return false; } if (finalize && !TruncateFile(file, pos.nPos)) { fclose(file); - error("%s: failed to truncate file %d", __func__, pos.nFile); + LogError("%s: failed to truncate file %d\n", __func__, pos.nFile); return false; } if (!FileCommit(file)) { fclose(file); - error("%s: failed to commit file %d", __func__, pos.nFile); + LogError("%s: failed to commit file %d\n", __func__, pos.nFile); return false; } DirectoryCommit(m_dir); -- cgit v1.2.3