diff options
| author | Konstantin Belousov <kib@FreeBSD.org> | 2014-02-01 18:13:18 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2014-02-01 18:13:18 +0000 |
| commit | 082aa03e4be1c1ea3324020222b63809def32bcf (patch) | |
| tree | 44d08f27b7b3769037fb4922cb692651c6b463ae /lib/libthr/thread | |
| parent | a865b1a02e41bb2ad3c24ce12f55afa7f0558e08 (diff) | |
Notes
Diffstat (limited to 'lib/libthr/thread')
| -rw-r--r-- | lib/libthr/thread/thr_kill.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/libthr/thread/thr_kill.c b/lib/libthr/thread/thr_kill.c index b54458c58575..8b0f68353ef7 100644 --- a/lib/libthr/thread/thr_kill.c +++ b/lib/libthr/thread/thr_kill.c @@ -42,24 +42,27 @@ __weak_reference(_pthread_kill, pthread_kill); int _pthread_kill(pthread_t pthread, int sig) { - struct pthread *curthread = _get_curthread(); + struct pthread *curthread; int ret; /* Check for invalid signal numbers: */ if (sig < 0 || sig > _SIG_MAXSIG) /* Invalid signal: */ - ret = EINVAL; + return (EINVAL); + + curthread = _get_curthread(); + /* * Ensure the thread is in the list of active threads, and the * signal is valid (signal 0 specifies error checking only) and * not being ignored: */ - else if (curthread == pthread) { + if (curthread == pthread) { if (sig > 0) _thr_send_sig(pthread, sig); ret = 0; - } if ((ret = _thr_find_thread(curthread, pthread, /*include dead*/0)) - == 0) { + } else if ((ret = _thr_find_thread(curthread, pthread, + /*include dead*/0)) == 0) { if (sig > 0) _thr_send_sig(pthread, sig); THR_THREAD_UNLOCK(curthread, pthread); |
