mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
For PR351:
* Allow the ExecuteAndWait to return negative values if a signal is detected as the reason for the child termination. This is needed to support bugpoint detecting bad things in its child processes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24960 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
171eee5471
commit
d555f413cd
@ -209,17 +209,22 @@ Program::ExecuteAndWait(const Path& path,
|
|||||||
sigaction(SIGALRM, &Old, 0);
|
sigaction(SIGALRM, &Old, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the program exited normally with a zero exit status, return success!
|
// Return the proper exit status. 0=success, >0 is programs' exit status,
|
||||||
|
// <0 means a signal was returned, -9999999 means the program dumped core.
|
||||||
|
int result = 0;
|
||||||
if (WIFEXITED (status))
|
if (WIFEXITED (status))
|
||||||
return WEXITSTATUS(status);
|
result = WEXITSTATUS(status);
|
||||||
else if (WIFSIGNALED(status))
|
else if (WIFSIGNALED(status))
|
||||||
return 1;
|
result = 0 - WTERMSIG(status);
|
||||||
|
#ifdef WCOREDUMP
|
||||||
#else
|
if (WCOREDUMP(status))
|
||||||
throw std::string(
|
result |= 0x01000000;
|
||||||
"Program::ExecuteAndWait not implemented on this platform!\n");
|
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return result;
|
||||||
|
#else
|
||||||
|
return -99;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user