diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-10-16 21:46:45 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-11-05 18:23:39 +0300 |
commit | 7a8386289b18678c2ee49ffdfcf71e3a2abd3258 (patch) | |
tree | 607ecc405df2584c2c652e15e6e9528fbb0eb3a4 /libbutl/fdstream.cxx | |
parent | 8ca3b4e5996e37411d866fb5fa1b1a86515aa628 (diff) |
Fix ifdstream::open() to set stream mode for passed file descriptor
Diffstat (limited to 'libbutl/fdstream.cxx')
-rw-r--r-- | libbutl/fdstream.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libbutl/fdstream.cxx b/libbutl/fdstream.cxx index 377681e..fad65f7 100644 --- a/libbutl/fdstream.cxx +++ b/libbutl/fdstream.cxx @@ -848,6 +848,13 @@ namespace butl } void ifdstream:: + open (auto_fd&& fd, fdstream_mode m, std::uint64_t pos) + { + open (mode (std::move (fd), m), pos); + skip_ = (m & fdstream_mode::skip) == fdstream_mode::skip; + } + + void ifdstream:: close () { if (skip_ && is_open () && good ()) |