summaryrefslogtreecommitdiff
path: root/src/StateFile.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-12-16 00:24:41 +0100
committerMax Kellermann <max@duempel.org>2015-12-16 00:33:33 +0100
commit7eae3bc8c530069e86026bf9d259e9a5ce9e4bce (patch)
treee71a55c8516b379586d90488ebf49d0f902af4b1 /src/StateFile.cxx
parent24b2198668ad5d0b3f965bc34762bfac4004bcf2 (diff)
fs/io/FileOutputStream: use C++ exceptions in Commit()
Diffstat (limited to 'src/StateFile.cxx')
-rw-r--r--src/StateFile.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/StateFile.cxx b/src/StateFile.cxx
index 8d17a1827..7c92ae0ee 100644
--- a/src/StateFile.cxx
+++ b/src/StateFile.cxx
@@ -92,10 +92,12 @@ StateFile::Write()
try {
Error error;
FileOutputStream fos(path);
- if (!Write(fos, error) || !fos.Commit(error)) {
+ if (!Write(fos, error)) {
LogError(error);
return;
}
+
+ fos.Commit();
} catch (const std::exception &e) {
LogError(e);
}