mirror of
https://github.com/git/git.git
synced 2026-01-31 21:09:39 +00:00
Merge branch 'consolez'
This fixes an issue where the Git wrapper would terminate upon Ctrl+C, even in the case when its child process would *not* terminate. Note: while the original intention was to fix running Git Bash in ConsoleZ, the bug fix applies also to running C:\Program Files\Git\bin\bash -l -i in a cmd window. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -651,8 +651,16 @@ int main(void)
|
||||
working_directory, /* use parent's */
|
||||
&si, &pi);
|
||||
if (br) {
|
||||
if (wait)
|
||||
if (wait) {
|
||||
/*
|
||||
* Ignore Ctrl+C: the called process needs
|
||||
* to handle this event correctly, then we
|
||||
* quit, too.
|
||||
*/
|
||||
SetConsoleCtrlHandler(NULL, TRUE);
|
||||
WaitForSingleObject(pi.hProcess, INFINITE);
|
||||
SetConsoleCtrlHandler(NULL, FALSE);
|
||||
}
|
||||
if (!GetExitCodeProcess(pi.hProcess, (DWORD *)&r))
|
||||
print_error(L"error reading exit code",
|
||||
GetLastError());
|
||||
|
||||
Reference in New Issue
Block a user