Fix return value of gnc_book_write_to_xml_file_v2()

81b9a02235 changed the behaviour of the
"success" variable that's used for the return value, so now the value is
being repeatedly overwritten instead of being combined with the result of
the next call.

Restore the original behaviour of setting success to false on failure.
This commit is contained in:
Simon Arlott 2023-06-24 11:41:44 +01:00
parent ba7b26066e
commit 4b83068c6b
No known key found for this signature in database
GPG Key ID: DF001BFD83E75990

View File

@ -1602,14 +1602,19 @@ gnc_book_write_to_xml_file_v2 (QofBook* book, const char* filename,
return false;
/* Try to write as much as possible */
success = (gnc_book_write_to_xml_filehandle_v2 (book, file));
if (!gnc_book_write_to_xml_filehandle_v2 (book, file))
success = false;
/* Close the output stream */
success = ! (fclose (file));
if (fclose (file))
success = false;
/* Optionally wait for parallel compression threads */
if (thread)
success = g_thread_join (thread) != nullptr;
{
if (g_thread_join (thread) != nullptr)
success = false;
}
return success;
}