File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 21
21
22
22
# include " exception_utils.h"
23
23
# include " invariant.h"
24
+ # include " message.h"
24
25
# include " narrow.h"
25
26
# include " optional.h"
26
27
# include " piped_process.h"
27
28
# include " string_utils.h"
28
29
29
30
# define BUFSIZE 2048
30
31
31
- piped_processt::piped_processt (const std::vector<std::string> commandvec)
32
+ piped_processt::piped_processt (const std::vector<std::string> commandvec,
33
+ message_handlert& message_handler)
32
34
{
33
35
# ifdef _WIN32
34
36
UNIMPLEMENTED_FEATURE (" Pipe IPC on windows." )
35
37
# else
36
38
39
+ messaget log (message_handler);
40
+
37
41
if (pipe (pipe_input) == -1 )
38
42
{
39
43
throw system_exceptiont (" Input pipe creation failed" );
@@ -92,8 +96,8 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
92
96
}
93
97
free (args);
94
98
// Only reachable if execvp failed
95
- std::cerr << " Launching " << commandvec[0 ]
96
- << " failed with error: " << std::strerror (errno) << std::endl ;
99
+ log. error () << " Launching " << commandvec[0 ]
100
+ << " failed with error: " << std::strerror (errno);
97
101
abort ();
98
102
}
99
103
else
Original file line number Diff line number Diff line change 12
12
# include < vector>
13
13
14
14
# include " optional.h"
15
+ # include " message.h"
15
16
16
17
# define PIPED_PROCESS_INFINITE_TIMEOUT \
17
18
optionalt<std::size_t > \
@@ -76,7 +77,7 @@ class piped_processt
76
77
// / Initiate a new subprocess with pipes supporting communication
77
78
// / between the parent (this process) and the child.
78
79
// / \param commandvec The command and arguments to create the process
79
- explicit piped_processt (const std::vector<std::string> commandvec);
80
+ explicit piped_processt (const std::vector<std::string> commandvec, message_handlert& );
80
81
81
82
~piped_processt ();
82
83
You can’t perform that action at this time.
0 commit comments