Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
98fc8ab9
Commit
98fc8ab9
authored
Feb 11, 2003
by
Linus Torvalds
Committed by
Linus Torvalds
Feb 11, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't wake up processes unnecessarily for ignored signals
parent
fcb96784
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
kernel/signal.c
kernel/signal.c
+25
-5
No files found.
kernel/signal.c
View file @
98fc8ab9
...
...
@@ -141,14 +141,34 @@ int max_queued_signals = 1024;
(((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_DFL) && \
((t)->sighand->action[(signr)-1].sa.sa_handler != SIG_IGN))
#define sig_ignored(t, signr) \
(!((t)->ptrace & PT_PTRACED) && \
(t)->sighand->action[(signr)-1].sa.sa_handler == SIG_IGN)
#define sig_fatal(t, signr) \
(!T(signr, SIG_KERNEL_IGNORE_MASK|SIG_KERNEL_STOP_MASK) && \
(t)->sighand->action[(signr)-1].sa.sa_handler == SIG_DFL)
static
inline
int
sig_ignored
(
struct
task_struct
*
t
,
int
sig
)
{
void
*
handler
;
/*
* Tracers always want to know about signals..
*/
if
(
t
->
ptrace
&
PT_PTRACED
)
return
0
;
/*
* Blocked signals are never ignored, since the
* signal handler may change by the time it is
* unblocked.
*/
if
(
sigismember
(
&
t
->
blocked
,
sig
))
return
0
;
/* Is it explicitly or implicitly ignored? */
handler
=
t
->
sighand
->
action
[
sig
-
1
].
sa
.
sa_handler
;
return
handler
==
SIG_IGN
||
(
handler
==
SIG_DFL
&&
sig_kernel_ignore
(
sig
));
}
/*
* Re-calculate pending state from the set of locally pending
* signals, globally pending signals, and blocked signals.
...
...
@@ -642,7 +662,7 @@ static void handle_stop_signal(int sig, struct task_struct *p)
* TIF_SIGPENDING
*/
state
=
TASK_STOPPED
;
if
(
!
sigismember
(
&
t
->
blocked
,
SIGCONT
))
{
if
(
sig_user_defined
(
t
,
SIGCONT
)
&&
!
sigismember
(
&
t
->
blocked
,
SIGCONT
))
{
set_tsk_thread_flag
(
t
,
TIF_SIGPENDING
);
state
|=
TASK_INTERRUPTIBLE
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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