From owner-svn-src-stable-10@FreeBSD.ORG Sat Feb 8 15:51:24 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E5EABBB0; Sat, 8 Feb 2014 15:51:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id CFE8B166D; Sat, 8 Feb 2014 15:51:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s18FpO9Q055489; Sat, 8 Feb 2014 15:51:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s18FpOhP055488; Sat, 8 Feb 2014 15:51:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201402081551.s18FpOhP055488@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 8 Feb 2014 15:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r261636 - stable/10/lib/libthr/thread X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Feb 2014 15:51:25 -0000 Author: kib Date: Sat Feb 8 15:51:24 2014 New Revision: 261636 URL: http://svnweb.freebsd.org/changeset/base/261636 Log: MFC r261354: In _pthread_kill(), if passed pthread is current thread, do not send the signal second time, by adding the missed else before if statement. PR: threads/186309 Modified: stable/10/lib/libthr/thread/thr_kill.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libthr/thread/thr_kill.c ============================================================================== --- stable/10/lib/libthr/thread/thr_kill.c Sat Feb 8 13:51:15 2014 (r261635) +++ stable/10/lib/libthr/thread/thr_kill.c Sat Feb 8 15:51:24 2014 (r261636) @@ -42,24 +42,27 @@ __weak_reference(_pthread_kill, pthread_ 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);