aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/fs/io/FileOutputStream.cxx7
-rw-r--r--src/fs/io/FileReader.cxx8
2 files changed, 7 insertions, 8 deletions
diff --git a/src/fs/io/FileOutputStream.cxx b/src/fs/io/FileOutputStream.cxx
index 819867780..2951149b9 100644
--- a/src/fs/io/FileOutputStream.cxx
+++ b/src/fs/io/FileOutputStream.cxx
@@ -20,7 +20,6 @@
#include "config.h"
#include "FileOutputStream.hxx"
#include "fs/FileSystem.hxx"
-#include "system/fd_util.h"
#include "util/Error.hxx"
#ifdef WIN32
@@ -82,9 +81,9 @@ FileOutputStream::Cancel()
FileOutputStream::FileOutputStream(Path _path, Error &error)
:path(_path),
- fd(open_cloexec(path.c_str(),
- O_WRONLY|O_CREAT|O_TRUNC,
- 0666))
+ fd(OpenFile(path,
+ O_WRONLY|O_CREAT|O_TRUNC,
+ 0666))
{
if (fd < 0)
error.FormatErrno("Failed to create %s", path.c_str());
diff --git a/src/fs/io/FileReader.cxx b/src/fs/io/FileReader.cxx
index fa8bf2f0b..01ffe95f2 100644
--- a/src/fs/io/FileReader.cxx
+++ b/src/fs/io/FileReader.cxx
@@ -19,7 +19,7 @@
#include "config.h"
#include "FileReader.hxx"
-#include "system/fd_util.h"
+#include "fs/FileSystem.hxx"
#include "util/Error.hxx"
#ifdef WIN32
@@ -64,9 +64,9 @@ FileReader::Close()
FileReader::FileReader(Path _path, Error &error)
:path(_path),
- fd(open_cloexec(path.c_str(),
- O_RDONLY,
- 0))
+ fd(OpenFile(path,
+ O_RDONLY,
+ 0))
{
if (fd < 0)
error.FormatErrno("Failed to open %s", path.c_str());