mirror of https://github.com/flysand7/ciabatta.git
tabs ==> spaces
This commit is contained in:
parent
470bce6c6d
commit
5890659112
|
@ -97,29 +97,29 @@ int system(const char* string) {
|
|||
MultiByteToWideChar(65001 /* UTF8 */, 0, string, -1, cmd_line + sizeof("cmd.exe ") - 1, wchars_required);
|
||||
|
||||
STARTUPINFOW si = {
|
||||
.cb = sizeof(STARTUPINFOW),
|
||||
.dwFlags = STARTF_USESTDHANDLES,
|
||||
.hStdInput = GetStdHandle(STD_INPUT_HANDLE),
|
||||
.hStdError = GetStdHandle(STD_ERROR_HANDLE),
|
||||
.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE)
|
||||
};
|
||||
PROCESS_INFORMATION pi = {};
|
||||
.cb = sizeof(STARTUPINFOW),
|
||||
.dwFlags = STARTF_USESTDHANDLES,
|
||||
.hStdInput = GetStdHandle(STD_INPUT_HANDLE),
|
||||
.hStdError = GetStdHandle(STD_ERROR_HANDLE),
|
||||
.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE)
|
||||
};
|
||||
PROCESS_INFORMATION pi = {};
|
||||
|
||||
if (!CreateProcessW(NULL, cmd_line, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
// Wait until child process exits.
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
// Wait until child process exits.
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
|
||||
DWORD exit_code;
|
||||
if (!GetExitCodeProcess(pi.hProcess, &exit_code)) {
|
||||
goto error;
|
||||
}
|
||||
|
||||
// Close process and thread handles.
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
// Close process and thread handles.
|
||||
CloseHandle(pi.hProcess);
|
||||
CloseHandle(pi.hThread);
|
||||
free(cmd_line);
|
||||
return exit_code;
|
||||
|
||||
|
|
Loading…
Reference in New Issue