From dee88723951e14283db5c814a31b7fb85dce2619 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Jan 2019 21:09:34 +0100 Subject: [PATCH] fs/io/FileOutputStream: move code to Open() --- src/fs/io/FileOutputStream.cxx | 6 ++++++ src/fs/io/FileOutputStream.hxx | 1 + 2 files changed, 7 insertions(+) diff --git a/src/fs/io/FileOutputStream.cxx b/src/fs/io/FileOutputStream.cxx index 082ca2fe8..0ee62a092 100644 --- a/src/fs/io/FileOutputStream.cxx +++ b/src/fs/io/FileOutputStream.cxx @@ -33,6 +33,12 @@ FileOutputStream::FileOutputStream(Path _path, Mode _mode) :path(_path), mode(_mode) +{ + Open(); +} + +inline void +FileOutputStream::Open() { switch (mode) { case Mode::CREATE: diff --git a/src/fs/io/FileOutputStream.hxx b/src/fs/io/FileOutputStream.hxx index 1f6a34ccf..a17350adc 100644 --- a/src/fs/io/FileOutputStream.hxx +++ b/src/fs/io/FileOutputStream.hxx @@ -133,6 +133,7 @@ public: private: void OpenCreate(bool visible); void OpenAppend(bool create); + void Open(); bool Close() noexcept { assert(IsDefined());