aboutsummaryrefslogtreecommitdiff
path: root/butl/pager.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-11-03 00:44:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-11-03 13:47:43 +0300
commit7ce74ce206065c3af0035583330b3c773086f21c (patch)
treefc0fb1d9bd0037299f12a27f1f38ac5056634568 /butl/pager.cxx
parentcc8a2a1517cc3c55bdeb066a038868fb8c7f04d6 (diff)
Invent auto_fd, make use of it in fdstreams and process
Diffstat (limited to 'butl/pager.cxx')
-rw-r--r--butl/pager.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/butl/pager.cxx b/butl/pager.cxx
index b154a5c..a03582c 100644
--- a/butl/pager.cxx
+++ b/butl/pager.cxx
@@ -15,6 +15,7 @@
#endif
#include <cstring> // strchr()
+#include <utility> // move()
#include <system_error>
#include <butl/fdstream> // fdclose()
@@ -134,13 +135,13 @@ namespace butl
bool r;
if (p_.try_wait (r))
{
- fdclose (p_.out_fd);
+ p_.out_fd.reset ();
if (pager != nullptr)
throw system_error (ECHILD, system_category ());
}
else
- os_.open (p_.out_fd);
+ os_.open (move (p_.out_fd));
}
catch (const process_error& e)
{