aboutsummaryrefslogtreecommitdiff
path: root/msvc-filter.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-11-03 00:49:50 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-11-03 14:02:25 +0300
commitaea091b431278c294c9dab348e654ae2e6616390 (patch)
treeec4aa0b73a02c7e1546f3b8997fa6ba6b9ede5ac /msvc-filter.cxx
parentff918e63ce478e250721c91eae77ec3477456b84 (diff)
Adopt to auto_fd introduced to libbutl fdstreams and process
Diffstat (limited to 'msvc-filter.cxx')
-rw-r--r--msvc-filter.cxx14
1 files 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 <string>
#include <cstring> // strchr()
#include <ostream>
+#include <utility> // move()
#include <iostream>
#include <algorithm> // max()
#include <system_error>
@@ -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;
}