mirror of
https://github.com/bitwiseworks/gcc-os2.git
synced 2026-02-04 00:54:37 +00:00
Fix error message on ctrl-c - patch from komh
(cherry picked from commit 9794c160f676c32d6ebb155a21f0891166189939)
This commit is contained in:
committed by
Dmitriy Kuminov
parent
e9ab217fcb
commit
55ad0e757f
@@ -365,9 +365,6 @@ pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status,
|
||||
pid_t ret;
|
||||
struct rusage r;
|
||||
|
||||
if (time == NULL)
|
||||
return waitpid (pid, status, 0);
|
||||
|
||||
ret = wait4 (pid, status, 0, &r);
|
||||
|
||||
if (time != NULL)
|
||||
@@ -378,6 +375,19 @@ pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status,
|
||||
time->system_microseconds= r.ru_stime.tv_usec;
|
||||
}
|
||||
|
||||
/* Suppress 'Internal error: Interrupt' caused by Ctrl-C and Ctrl-Break */
|
||||
if (status && WIFSIGNALED (*status))
|
||||
{
|
||||
switch (WTERMSIG (*status))
|
||||
{
|
||||
case SIGINT: /* Ctrl-C */
|
||||
case SIGBREAK: /* Ctrl-Break */
|
||||
/* Clear a signaled status and use SIGINT as a return code */
|
||||
*status = SIGINT << 8;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user