Bug 599478: Fix incorrect exit code for unhandled signal termination in nsIProcess on Mac OS X. r=bsmedberg a=blocking2.0betaN+

This commit is contained in:
Josh Aas 2010-10-25 16:57:18 -04:00
Родитель 3aa785b585
Коммит 05a5607c2a
2 изменённых файлов: 8 добавлений и 7 удалений

Просмотреть файл

@ -251,11 +251,6 @@ function test_kill_2()
}
function run_test() {
var isOSX = ("nsILocalFileMac" in Components.interfaces);
if (isOSX) {
dump("INFO | test_nsIProcess.js | Skipping test on mac, bug 599478")
return;
}
set_environment();
test_kill();
test_quick();

Просмотреть файл

@ -287,8 +287,14 @@ void PR_CALLBACK nsProcess::Monitor(void *arg)
#ifdef XP_MACOSX
int exitCode = -1;
int status = 0;
if (waitpid(process->mPid, &status, 0) == process->mPid && WIFEXITED(status))
exitCode = WEXITSTATUS(status);
if (waitpid(process->mPid, &status, 0) == process->mPid) {
if (WIFEXITED(status)) {
exitCode = WEXITSTATUS(status);
}
else if(WIFSIGNALED(status)) {
exitCode = 256; // match NSPR's signal exit status
}
}
#else
PRInt32 exitCode = -1;
if (PR_WaitProcess(process->mProcess, &exitCode) != PR_SUCCESS)