summaryrefslogtreecommitdiff
path: root/src/PlaylistFile.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/PlaylistFile.cxx
parent24b2198668ad5d0b3f965bc34762bfac4004bcf2 (diff)
fs/io/FileOutputStream: use C++ exceptions in Commit()
Diffstat (limited to 'src/PlaylistFile.cxx')
-rw-r--r--src/PlaylistFile.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx
index 259c26974..c90af9760 100644
--- a/src/PlaylistFile.cxx
+++ b/src/PlaylistFile.cxx
@@ -239,7 +239,11 @@ SavePlaylistFile(const PlaylistFileContents &contents, const char *utf8path,
for (const auto &uri_utf8 : contents)
playlist_print_uri(bos, uri_utf8.c_str());
- return bos.Flush(error) && fos.Commit(error);
+ if (!bos.Flush(error))
+ return false;
+
+ fos.Commit();
+ return true;
}
PlaylistFileContents
@@ -411,9 +415,11 @@ spl_append_song(const char *utf8path, const DetachedSong &song, Error &error)
playlist_print_song(bos, song);
- if (!bos.Flush(error) || !fos.Commit(error))
+ if (!bos.Flush(error))
return false;
+ fos.Commit();
+
idle_add(IDLE_STORED_PLAYLIST);
return true;
}