Commit ac5c215383f43a106ba4ef298126bf78c126f5e9
Committed by
Linus Torvalds
1 parent
e62e6650e9
Exists in
master
and in
7 other branches
signals: join send_sigqueue() with send_group_sigqueue()
We export send_sigqueue() and send_group_sigqueue() for the only user, posix_timer_event(). This is a bit silly, because both are just trivial helpers on top of do_send_sigqueue() and because the we pass the unused .si_signo parameter. Kill them both, rename do_send_sigqueue() to send_sigqueue(), and export it. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Showing 3 changed files with 4 additions and 20 deletions Side-by-side Diff
include/linux/sched.h
... | ... | @@ -1751,8 +1751,7 @@ |
1751 | 1751 | extern int kill_proc(pid_t, int, int); |
1752 | 1752 | extern struct sigqueue *sigqueue_alloc(void); |
1753 | 1753 | extern void sigqueue_free(struct sigqueue *); |
1754 | -extern int send_sigqueue(int, struct sigqueue *, struct task_struct *); | |
1755 | -extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); | |
1754 | +extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); | |
1756 | 1755 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); |
1757 | 1756 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); |
1758 | 1757 |
kernel/posix-timers.c
... | ... | @@ -310,8 +310,7 @@ |
310 | 310 | |
311 | 311 | if (timr->it_sigev_notify & SIGEV_THREAD_ID) { |
312 | 312 | struct task_struct *leader; |
313 | - int ret = send_sigqueue(timr->it_sigev_signo, timr->sigq, | |
314 | - timr->it_process); | |
313 | + int ret = send_sigqueue(timr->sigq, timr->it_process, 0); | |
315 | 314 | |
316 | 315 | if (likely(ret >= 0)) |
317 | 316 | return ret; |
... | ... | @@ -322,8 +321,7 @@ |
322 | 321 | timr->it_process = leader; |
323 | 322 | } |
324 | 323 | |
325 | - return send_group_sigqueue(timr->it_sigev_signo, timr->sigq, | |
326 | - timr->it_process); | |
324 | + return send_sigqueue(timr->sigq, timr->it_process, 1); | |
327 | 325 | } |
328 | 326 | EXPORT_SYMBOL_GPL(posix_timer_event); |
329 | 327 |
kernel/signal.c
... | ... | @@ -1240,8 +1240,7 @@ |
1240 | 1240 | __sigqueue_free(q); |
1241 | 1241 | } |
1242 | 1242 | |
1243 | -static int do_send_sigqueue(struct sigqueue *q, struct task_struct *t, | |
1244 | - int group) | |
1243 | +int send_sigqueue(struct sigqueue *q, struct task_struct *t, int group) | |
1245 | 1244 | { |
1246 | 1245 | int sig = q->info.si_signo; |
1247 | 1246 | struct sigpending *pending; |
... | ... | @@ -1266,7 +1265,6 @@ |
1266 | 1265 | * If an SI_TIMER entry is already queue just increment |
1267 | 1266 | * the overrun count. |
1268 | 1267 | */ |
1269 | - | |
1270 | 1268 | BUG_ON(q->info.si_code != SI_TIMER); |
1271 | 1269 | q->info.si_overrun++; |
1272 | 1270 | goto out; |
... | ... | @@ -1281,17 +1279,6 @@ |
1281 | 1279 | unlock_task_sighand(t, &flags); |
1282 | 1280 | ret: |
1283 | 1281 | return ret; |
1284 | -} | |
1285 | - | |
1286 | -int send_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) | |
1287 | -{ | |
1288 | - return do_send_sigqueue(q, p, 0); | |
1289 | -} | |
1290 | - | |
1291 | -int | |
1292 | -send_group_sigqueue(int sig, struct sigqueue *q, struct task_struct *p) | |
1293 | -{ | |
1294 | - return do_send_sigqueue(q, p, 1); | |
1295 | 1282 | } |
1296 | 1283 | |
1297 | 1284 | /* |