From 7ce74ce206065c3af0035583330b3c773086f21c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 3 Nov 2016 00:44:53 +0300 Subject: Invent auto_fd, make use of it in fdstreams and process --- butl/pager.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'butl/pager.cxx') 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 // strchr() +#include // move() #include #include // 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) { -- cgit v1.1