We always handled signals as if their SA_RESTART flag was set - but that's not
the default case. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19711 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -76,6 +76,7 @@ handle_signals(struct thread *thread)
|
|||||||
& ~atomic_get(&thread->sig_block_mask);
|
& ~atomic_get(&thread->sig_block_mask);
|
||||||
struct sigaction *handler;
|
struct sigaction *handler;
|
||||||
bool reschedule = false;
|
bool reschedule = false;
|
||||||
|
bool restart = false;
|
||||||
int32 i;
|
int32 i;
|
||||||
|
|
||||||
// If SIGKILL[THR] are pending, we ignore other signals.
|
// If SIGKILL[THR] are pending, we ignore other signals.
|
||||||
@@ -110,6 +111,9 @@ handle_signals(struct thread *thread)
|
|||||||
|
|
||||||
TRACE(("Thread 0x%lx received signal %s\n", thread->id, sigstr[signal]));
|
TRACE(("Thread 0x%lx received signal %s\n", thread->id, sigstr[signal]));
|
||||||
|
|
||||||
|
if ((handler->sa_flags & SA_RESTART) != 0)
|
||||||
|
restart = true;
|
||||||
|
|
||||||
if (handler->sa_handler == SIG_IGN) {
|
if (handler->sa_handler == SIG_IGN) {
|
||||||
// signal is to be ignored
|
// signal is to be ignored
|
||||||
// ToDo: apply zombie cleaning on SIGCHLD
|
// ToDo: apply zombie cleaning on SIGCHLD
|
||||||
@@ -197,7 +201,10 @@ handle_signals(struct thread *thread)
|
|||||||
return reschedule;
|
return reschedule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only restart if SA_RESTART was set on at least one handler
|
||||||
|
if (restart)
|
||||||
arch_check_syscall_restart(thread);
|
arch_check_syscall_restart(thread);
|
||||||
|
|
||||||
return reschedule;
|
return reschedule;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user