Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
process
Commits
54038240
Commit
54038240
authored
Sep 24, 2012
by
Simon Marlow
Browse files
Use (128+signal) as the exit code when a proc terminates due to a signal (#7229)
parent
0cae6ea0
Changes
1
Hide whitespace changes
Inline
Side-by-side
cbits/runProcess.c
View file @
54038240
...
...
@@ -22,6 +22,13 @@
UNIX versions
------------------------------------------------------------------------- */
//
// If a process terminates with a signal, the exit status we return to
// via the System.Process API follows the Unix shell convention of
// (128 + signal).
//
#define TERMSIG_STATUS(r) ((r) | 0x80)
static
long
max_fd
=
0
;
// Rts internal API, not exposed in a public header file:
...
...
@@ -245,8 +252,8 @@ getProcessExitCode (ProcHandle handle, int *pExitCode)
else
if
(
WIFSIGNALED
(
wstat
))
{
errno
=
EINTR
;
return
-
1
;
*
pExitCode
=
TERMSIG_STATUS
(
WTERMSIG
(
wstat
))
;
return
1
;
}
else
{
...
...
@@ -281,7 +288,7 @@ int waitForProcess (ProcHandle handle, int *pret)
else
if
(
WIFSIGNALED
(
wstat
))
{
*
pret
=
wstat
;
*
pret
=
TERMSIG_STATUS
(
WTERMSIG
(
wstat
))
;
return
0
;
}
else
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment