@@ -164,8 +164,6 @@ int ExecuteCommand::PipeChildToStdStream(DWORD STD_HANDLE,
164
164
165
165
for (;;) {
166
166
b_success = ReadFile (reader_handle, ch_buf, BUFSIZE, &dw_read, NULL );
167
- // For an explanation behind the use of termianted here
168
- // see the docstring on pipechildtostdout
169
167
if (!b_success || (dw_read == 0 && this ->terminated ))
170
168
break ;
171
169
if (dw_read != 0 ) {
@@ -201,66 +199,6 @@ int ExecuteCommand::PipeChildToStdStream(DWORD STD_HANDLE,
201
199
return static_cast <int >(static_cast <int >(b_success) == 0 );
202
200
}
203
201
204
- // /*
205
- // * Reads for the member variable holding a pipe to the wrapped processes'
206
- // * STDERR and writes either to this processes' STDERR or a file, depending on
207
- // * how the process wrapper is configured
208
- // */
209
- // int ExecuteCommand::PipeChildToStdErr()
210
- // {
211
- // DWORD dwRead, dwWritten;
212
- // CHAR chBuf[BUFSIZE];
213
- // BOOL bSuccess = TRUE;
214
- // HANDLE hParentOut;
215
- // if (this->write_to_file) {
216
- // hParentOut = this->fileout;
217
- // }
218
- // else {
219
- // hParentOut = GetStdHandle(STD_ERROR_HANDLE);
220
- // }
221
-
222
- // for (;;)
223
- // {
224
- // bSuccess = ReadFile( this->ChildStdErr_Rd, chBuf, BUFSIZE, &dwRead, NULL);
225
- // if( ! bSuccess || dwRead == 0 ) break;
226
-
227
- // bSuccess = WriteFile(hParentOut, chBuf,
228
- // dwRead, &dwWritten, NULL);
229
- // if (! bSuccess ) break;
230
- // }
231
- // return !bSuccess;
232
- // }
233
-
234
- // /*
235
- // * Reads for the member variable holding a pipe to the wrapped processes'
236
- // * STDOUT and writes either to this processes' STDOUT or a file, depending on
237
- // * how the process wrapper is configured
238
- // */
239
- // int ExecuteCommand::PipeChildToStdout()
240
- // {
241
- // DWORD dwRead, dwWritten;
242
- // CHAR chBuf[BUFSIZE];
243
- // BOOL bSuccess = TRUE;
244
- // HANDLE hParentOut;
245
- // if (this->write_to_file) {
246
- // hParentOut = this->fileout;
247
- // }
248
- // else {
249
- // hParentOut = GetStdHandle(STD_OUTPUT_HANDLE);
250
- // }
251
-
252
- // for (;;)
253
- // {
254
- // bSuccess = ReadFile( this->ChildStdOut_Rd, chBuf, BUFSIZE, &dwRead, NULL);
255
- // if( ! bSuccess || dwRead == 0 ) break;
256
-
257
- // bSuccess = WriteFile(hParentOut, chBuf,
258
- // dwRead, &dwWritten, NULL);
259
- // if (! bSuccess ) break;
260
- // }
261
- // return !bSuccess;
262
- // }
263
-
264
202
/*
265
203
* Ensures handles and their underlying resources are
266
204
* cleaned
0 commit comments