From: bert Dvornik Date: Thu, 20 May 2010 18:57:52 +0000 (+0200) Subject: start_command: close cmd->err descriptor when fork/spawn fails X-Git-Tag: v1.7.2-rc0~132^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/fc012c2810c237dd2299a3fc85b18c2beb60b730?hp=fc012c2810c237dd2299a3fc85b18c2beb60b730 start_command: close cmd->err descriptor when fork/spawn fails Fix the problem where the cmd->err passed into start_command wasn't being properly closed when certain types of errors occurr. (Compare the affected code with the clean shutdown code later in the function.) On Windows, this problem would be triggered if mingw_spawnvpe() failed, which would happen if the command to be executed was malformed (e.g. a text file that didn't start with a #! line). If cmd->err was a pipe, the failure to close it could result in a hang while the other side was waiting (forever) for either input or pipe close, e.g. while trying to shove the output into the side band. On msysGit, this problem was causing a hang in t5516-fetch-push. [J6t: With a slight adjustment of the test case, the hang is also observed on Linux.] Signed-off-by: bert Dvornik Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano ---