MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / get_exit_status

Method get_exit_status

lib/tiny-process/process_win.cpp:264–288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264int Process::get_exit_status() noexcept {
265 if(data.id == 0)
266 return -1;
267
268 if(!data.handle)
269 return data.exit_status;
270
271 WaitForSingleObject(data.handle, INFINITE);
272
273 DWORD exit_status;
274 if(!GetExitCodeProcess(data.handle, &exit_status))
275 data.exit_status = -1; // Store exit status for future calls
276 else
277 data.exit_status = static_cast<int>(exit_status); // Store exit status for future calls
278
279 {
280 std::lock_guard<std::mutex> lock(close_mutex);
281 CloseHandle(data.handle);
282 data.handle = nullptr;
283 closed = true;
284 }
285 close_fds();
286
287 return data.exit_status;
288}
289
290bool Process::try_get_exit_status(int &exit_status) noexcept {
291 if(data.id == 0) {

Callers 4

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls

no outgoing calls

Tested by 3

mainFunction · 0.36
mainFunction · 0.36
mainFunction · 0.36