libposix: fix default_signal_disposition
This commit is contained in:
parent
da0381a213
commit
8d5eb5914f
|
@ -153,14 +153,15 @@ send_signal(int *errnop, int pid, int signal)
|
||||||
|
|
||||||
|
|
||||||
static PosixSignalDisposition
|
static PosixSignalDisposition
|
||||||
default_signal_disposition(int signal)
|
default_signal_disposition(int code)
|
||||||
{
|
{
|
||||||
// see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
|
// see http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html
|
||||||
switch(signal){
|
if(code >= __sigrtmin || code <= __sigrtmin)
|
||||||
default:
|
|
||||||
if(signal >= __sigrtmin || signal <= __sigrtmin)
|
|
||||||
return TerminateTheProcess;
|
return TerminateTheProcess;
|
||||||
break;
|
|
||||||
|
switch(__code_to_signal_map[code]){
|
||||||
|
default:
|
||||||
|
sysfatal("libposix: undefined signal %d", code);
|
||||||
|
|
||||||
case PosixSIGALRM:
|
case PosixSIGALRM:
|
||||||
case PosixSIGHUP:
|
case PosixSIGHUP:
|
||||||
|
@ -196,7 +197,6 @@ default_signal_disposition(int signal)
|
||||||
case PosixSIGCONT:
|
case PosixSIGCONT:
|
||||||
return ResumeTheProcess;
|
return ResumeTheProcess;
|
||||||
}
|
}
|
||||||
sysfatal("libposix: unknown PosixSignal %d", signal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
@ -267,7 +267,10 @@ __libposix_note_handler(void *ureg, char *note)
|
||||||
if(sig < __min_known_sig || sig > __max_known_sig)
|
if(sig < __min_known_sig || sig > __max_known_sig)
|
||||||
sysfatal("libposix: '%s' does not carry a signal", note);
|
sysfatal("libposix: '%s' does not carry a signal", note);
|
||||||
*__handling_external_signal = 1;
|
*__handling_external_signal = 1;
|
||||||
action = __libposix_signal_trampoline(sig);
|
if(__libposix_signal_trampoline(sig))
|
||||||
|
action = SignalHandled;
|
||||||
|
else
|
||||||
|
action = default_signal_disposition(sig);
|
||||||
ret = execute_disposition(sig, action, -1);
|
ret = execute_disposition(sig, action, -1);
|
||||||
*__handling_external_signal = 0;
|
*__handling_external_signal = 0;
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in New Issue