From 7a8386289b18678c2ee49ffdfcf71e3a2abd3258 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 16 Oct 2020 21:46:45 +0300 Subject: Fix ifdstream::open() to set stream mode for passed file descriptor --- libbutl/fdstream.cxx | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libbutl/fdstream.cxx') 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 ()) -- cgit v1.1