fixed bug #1909458 - nsEcec: cannot handle exit code 259

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@5584 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2008-03-29 17:53:23 +00:00
parent 1084ca06c6
commit f2cd51e787

View file

@ -208,7 +208,8 @@ params:
HANDLE newstdout=0,read_stdout=0; HANDLE newstdout=0,read_stdout=0;
HANDLE newstdin=0,read_stdin=0; HANDLE newstdin=0,read_stdin=0;
DWORD dwRead = 1; DWORD dwRead = 1;
DWORD dwExit = !STILL_ACTIVE; DWORD dwExit = 0;
DWORD dwWait = WAIT_TIMEOUT;
DWORD dwLastOutput; DWORD dwLastOutput;
static char szBuf[1024]; static char szBuf[1024];
HGLOBAL hUnusedBuf = NULL; HGLOBAL hUnusedBuf = NULL;
@ -254,7 +255,7 @@ params:
dwLastOutput = GetTickCount(); dwLastOutput = GetTickCount();
while (dwExit == STILL_ACTIVE || dwRead) { while (dwWait != WAIT_OBJECT_0 || dwRead) {
PeekNamedPipe(read_stdout, 0, 0, 0, &dwRead, NULL); PeekNamedPipe(read_stdout, 0, 0, 0, &dwRead, NULL);
if (dwRead) { if (dwRead) {
dwLastOutput = GetTickCount(); dwLastOutput = GetTickCount();
@ -331,11 +332,11 @@ params:
} }
else Sleep(LOOPTIMEOUT); else Sleep(LOOPTIMEOUT);
} }
dwWait = WaitForSingleObject(pi.hProcess, 0);
GetExitCodeProcess(pi.hProcess, &dwExit); GetExitCodeProcess(pi.hProcess, &dwExit);
if (dwExit != STILL_ACTIVE) {
PeekNamedPipe(read_stdout, 0, 0, 0, &dwRead, NULL); PeekNamedPipe(read_stdout, 0, 0, 0, &dwRead, NULL);
} }
}
done: done:
if (log & 2) pushstring(szUnusedBuf); if (log & 2) pushstring(szUnusedBuf);
if (log & 1 && *szUnusedBuf) LogMessage(szUnusedBuf, bOEM); if (log & 1 && *szUnusedBuf) LogMessage(szUnusedBuf, bOEM);