From aea091b431278c294c9dab348e654ae2e6616390 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Thu, 3 Nov 2016 00:49:50 +0300 Subject: Adopt to auto_fd introduced to libbutl fdstreams and process --- msvc-filter.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/msvc-filter.cxx b/msvc-filter.cxx index 2094ab8..a0555cf 100644 --- a/msvc-filter.cxx +++ b/msvc-filter.cxx @@ -9,6 +9,7 @@ #include #include // strchr() #include +#include // move() #include #include // max() #include @@ -125,7 +126,7 @@ filter (const char* s, size_t n, ostream& os) // main()). // process pr (args, 0, -1, -2); - ifdstream is (pr.in_ofd); + ifdstream is (move (pr.in_ofd)); string pd; getline (is, pd); @@ -223,11 +224,12 @@ try // Stream to filter from. // - ifdstream isf (pr.in_efd, fdstream_mode::non_blocking); + ifdstream isf (move (pr.in_efd), fdstream_mode::non_blocking); // Stream to proxy from. // - ifdstream isp (diag == 1 ? -1 : pr.in_ofd, fdstream_mode::non_blocking); + ifdstream isp ( + diag == 1 ? nullfd : move (pr.in_ofd), fdstream_mode::non_blocking); ostream& osf (diag == 1 ? cout : cerr); // Stream to filter to. ostream* osp (diag == 1 ? nullptr : &cout); // Stream to proxy to. @@ -403,9 +405,9 @@ try isp.close (); // Passing through the exact child process exit status on failure tends to be - // a bit hairy as involves usage of WIFEXITED(), WEXITSTATUS() and handling - // the situation when the process is terminated with a signal and so exit - // code is unavailable. Lets implement when really required. + // a bit hairy as involves handling the situation when the process is + // terminated with a signal and so exit code is unavailable. Lets implement + // when really required. // return pr.wait () ? 0 : 1; } -- cgit v1.1