repair signal implementation.
- Don't intrrupt syscall with the ignored signal.
This commit is contained in:
@@ -561,10 +561,10 @@ do_kill(int pid, int tid, int sig, siginfo_t *info)
|
|||||||
struct process *tproc = NULL;
|
struct process *tproc = NULL;
|
||||||
int i;
|
int i;
|
||||||
__sigset_t mask;
|
__sigset_t mask;
|
||||||
struct sig_pending *pending;
|
|
||||||
struct list_head *head;
|
struct list_head *head;
|
||||||
int rc;
|
int rc;
|
||||||
unsigned long irqstate = 0;
|
unsigned long irqstate = 0;
|
||||||
|
struct k_sigaction *k;
|
||||||
int doint;
|
int doint;
|
||||||
ihk_spinlock_t *savelock = NULL;
|
ihk_spinlock_t *savelock = NULL;
|
||||||
int found = 0;
|
int found = 0;
|
||||||
@@ -728,30 +728,35 @@ do_kill(int pid, int tid, int sig, siginfo_t *info)
|
|||||||
/* Put signal event even when handler is SIG_IGN or SIG_DFL
|
/* Put signal event even when handler is SIG_IGN or SIG_DFL
|
||||||
because target ptraced process must call ptrace_report_signal
|
because target ptraced process must call ptrace_report_signal
|
||||||
in check_signal */
|
in check_signal */
|
||||||
pending = NULL;
|
|
||||||
rc = 0;
|
rc = 0;
|
||||||
if (sig < 33) { // SIGRTMIN - SIGRTMAX
|
k = tproc->sighandler->action + sig - 1;
|
||||||
list_for_each_entry(pending, head, list){
|
if(k->sa.sa_handler != (void *)1 &&
|
||||||
if(pending->sigmask.__val[0] == mask)
|
(k->sa.sa_handler != NULL ||
|
||||||
break;
|
(sig != SIGCHLD && sig != SIGURG))){
|
||||||
|
struct sig_pending *pending = NULL;
|
||||||
|
if (sig < 33) { // SIGRTMIN - SIGRTMAX
|
||||||
|
list_for_each_entry(pending, head, list){
|
||||||
|
if(pending->sigmask.__val[0] == mask)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(&pending->list == head)
|
||||||
|
pending = NULL;
|
||||||
}
|
}
|
||||||
if(&pending->list == head)
|
if(pending == NULL){
|
||||||
pending = NULL;
|
doint = 1;
|
||||||
}
|
pending = kmalloc(sizeof(struct sig_pending), IHK_MC_AP_NOWAIT);
|
||||||
if(pending == NULL){
|
if(!pending){
|
||||||
doint = 1;
|
rc = -ENOMEM;
|
||||||
pending = kmalloc(sizeof(struct sig_pending), IHK_MC_AP_NOWAIT);
|
}
|
||||||
if(!pending){
|
else{
|
||||||
rc = -ENOMEM;
|
pending->sigmask.__val[0] = mask;
|
||||||
}
|
memcpy(&pending->info, info, sizeof(siginfo_t));
|
||||||
else{
|
if(sig == SIGKILL || sig == SIGSTOP)
|
||||||
pending->sigmask.__val[0] = mask;
|
list_add(&pending->list, head);
|
||||||
memcpy(&pending->info, info, sizeof(siginfo_t));
|
else
|
||||||
if(sig == SIGKILL || sig == SIGSTOP)
|
list_add_tail(&pending->list, head);
|
||||||
list_add(&pending->list, head);
|
tproc->sigevent = 1;
|
||||||
else
|
}
|
||||||
list_add_tail(&pending->list, head);
|
|
||||||
tproc->sigevent = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user