return NULL;
}
start_info.hStdInput = in_fd[0];
- result->in_fd = _open_osfhandle((intptr_t)in_fd[1], _O_APPEND);
+ result->in_fd = _open_osfhandle((intptr_t)in_fd[1], _O_WRONLY);
if ( !SetHandleInformation(in_fd[1], HANDLE_FLAG_INHERIT, 0) )
return NULL;
} else {
&start_info,
&proc_info);
+ if (pipeflag & 1) CloseHandle(in_fd[0]);
+ if (pipeflag & 2) CloseHandle(out_fd[1]);
+ if (pipeflag & 3) CloseHandle(err_fd[1]);
+
// Error?
if (!created) {
result->running = 0;
close(err_fd[1]);
} else
result->err_fd = -1;
+ } else {
+ perror("Process:");
+ return NULL;
}
return result;
redef fun read_char do return stream_in.read_char
- redef fun read_byte do return stream_in.read_byte
+ redef fun raw_read_byte do return stream_in.read_byte
redef fun eof do return stream_in.eof