From 196ce8426b152f2abbe28bf4cc3868bbe7a90def Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 15 Aug 2016 22:42:44 +0200 Subject: [PATCH] fs/io/FileOutputStream: decouple from the FileSystem library --- src/fs/io/FileOutputStream.cxx | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/fs/io/FileOutputStream.cxx b/src/fs/io/FileOutputStream.cxx index fafde30da..f7d88d7fb 100644 --- a/src/fs/io/FileOutputStream.cxx +++ b/src/fs/io/FileOutputStream.cxx @@ -19,7 +19,6 @@ #include "config.h" #include "FileOutputStream.hxx" -#include "fs/FileSystem.hxx" #include "system/Error.hxx" #ifdef WIN32 @@ -77,10 +76,7 @@ FileOutputStream::Cancel() Close(); - try { - RemoveFile(GetPath()); - } catch (std::runtime_error) { - } + DeleteFile(GetPath().c_str()); } #else @@ -157,10 +153,7 @@ FileOutputStream::Commit() #if HAVE_LINKAT if (is_tmpfile) { - try { - RemoveFile(GetPath()); - } catch (std::runtime_error) { - } + unlink(GetPath().c_str()); /* hard-link the temporary file to the final path */ char fd_path[64]; @@ -193,10 +186,7 @@ FileOutputStream::Cancel() #ifdef HAVE_LINKAT if (!is_tmpfile) #endif - try { - RemoveFile(GetPath()); - } catch (std::runtime_error) { - } + unlink(GetPath().c_str()); } #endif