fs/io/FileOutputStream: use C++ exceptions in Commit()

This commit is contained in:
Max Kellermann
2015-12-16 00:24:41 +01:00
parent 24b2198668
commit 7eae3bc8c5
8 changed files with 61 additions and 44 deletions

View File

@@ -61,16 +61,12 @@ main(int argc, char **argv)
const Path path = Path::FromFS(argv[1]);
try {
Error error;
FileOutputStream fos(path);
if (!Copy(fos, STDIN_FILENO))
return EXIT_FAILURE;
if (!fos.Commit(error)) {
fprintf(stderr, "%s\n", error.GetMessage());
return EXIT_FAILURE;
}
fos.Commit();
return EXIT_SUCCESS;
} catch (const std::exception &e) {