MCPcopy Create free account
hub / github.com/AGWA/git-crypt / stdout_pipe

Method stdout_pipe

coprocess-win32.cpp:177–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177std::istream* Coprocess::stdout_pipe ()
178{
179 if (!stdout_pipe_istream) {
180 SECURITY_ATTRIBUTES sec_attr;
181
182 // Set the bInheritHandle flag so pipe handles are inherited.
183 sec_attr.nLength = sizeof(SECURITY_ATTRIBUTES);
184 sec_attr.bInheritHandle = TRUE;
185 sec_attr.lpSecurityDescriptor = nullptr;
186
187 // Create a pipe for the child process's STDOUT.
188 if (!CreatePipe(&stdout_pipe_reader, &stdout_pipe_writer, &sec_attr, 0)) {
189 throw System_error("CreatePipe", "", GetLastError());
190 }
191
192 // Ensure the read handle to the pipe for STDOUT is not inherited.
193 if (!SetHandleInformation(stdout_pipe_reader, HANDLE_FLAG_INHERIT, 0)) {
194 throw System_error("SetHandleInformation", "", GetLastError());
195 }
196
197 stdout_pipe_istream = new ifhstream(this, read_stdout);
198 }
199 return stdout_pipe_istream;
200}
201
202void Coprocess::close_stdout ()
203{

Callers

nothing calls this directly

Calls 1

System_errorClass · 0.85

Tested by

no test coverage detected