Message ID | 20140427160257.GA5627@domone.podge |
---|---|
State | Committed |
Headers |
Return-Path: <x14307373@homiemail-mx20.g.dreamhost.com> X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 6DCE036007A for <siddhesh@wilcox.dreamhost.com>; Sun, 27 Apr 2014 09:03:44 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14307373) id 25960413BB371; Sun, 27 Apr 2014 09:03:44 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id E3AFF413BB398 for <glibc@patchwork.siddhesh.in>; Sun, 27 Apr 2014 09:03:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; q=dns; s=default; b=eLFvd3ZNNeSaCwuLFzsJJM4d08lm+ q9Op0JQ382QoDPVWYcw1MC0lSq7GYEC0mYzOJeo81Up49KETHmf2y66sKXs7bnqj df1ZgY3pQknT2NPsuC5a/AojBZPSjmymj1QLdluAZxhS+l3n/BM0/miloWmAmhaD bGv1mUGuTWHFbc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:subject:message-id:mime-version :content-type; s=default; bh=cGsXxsitFupygNCcpYuz7pCTYGA=; b=cvL cbORVwmN4iImCOHJvYBS0nDpBlwiux4GTGXmyzZvbNy+SxnBaS6vzF2xd0t3CjIt jAX13rtx8WJoTMfC+44YLWGrOJ3LYCZ5yjlDOE6FswKy8/sdZeH5a9hXuqNmRrBc C440bP7Y24VlcLvhyz3xWSE5soPja4T+nAneCnfQ= Received: (qmail 15324 invoked by alias); 27 Apr 2014 16:03:41 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-glibc=patchwork.siddhesh.in@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 15289 invoked by uid 89); 27 Apr 2014 16:03:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, SPF_NEUTRAL autolearn=no version=3.3.2 X-HELO: popelka.ms.mff.cuni.cz Date: Sun, 27 Apr 2014 18:02:57 +0200 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= <neleai@seznam.cz> To: libc-alpha@sourceware.org Subject: [PATCH][BZ #16876] Fix typo in nptl/sockperf.c Message-ID: <20140427160257.GA5627@domone.podge> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-DH-Original-To: glibc@patchwork.siddhesh.in |
Commit Message
Ondrej Bilka
April 27, 2014, 4:02 p.m. UTC
Hi, as described in https://sourceware.org/bugzilla/show_bug.cgi?id=16876 relevant if test does not make sense as it tests if pointer is negative. A clisock variable is unused outside of this test so we should fix it to intended behaviour. OK to commit? [BZ #16876] * nptl/sockperf.c (client): Check if socket exist.
Comments
On Sun, Apr 27, 2014 at 06:02:57PM +0200, Ondřej Bílka wrote: > Hi, as described in > > https://sourceware.org/bugzilla/show_bug.cgi?id=16876 > > relevant if test does not make sense as it tests if pointer is negative. > A clisock variable is unused outside of this test so we should fix it to > intended behaviour. > > OK to commit? > > > [BZ #16876] > * nptl/sockperf.c (client): Check if socket exist. > > diff --git a/nptl/sockperf.c b/nptl/sockperf.c > index 740fb88..2d4b872 100644 > --- a/nptl/sockperf.c > +++ b/nptl/sockperf.c > @@ -71,7 +71,6 @@ client (void *arg) > struct thread_param *param = arg; > unsigned int cnt; > unsigned int nserv = param->nserv; > - int clisock[nserv]; > struct pollfd servpoll[nserv]; > struct sockaddr_un servaddr; > socklen_t servlen; > @@ -102,7 +101,7 @@ client (void *arg) > for (cnt = 0; cnt < nserv; ++cnt) > { > servpoll[cnt].fd = socket (AF_UNIX, SOCK_STREAM, 0); > - if (clisock < 0) > + if (servpoll[cnt].fd < 0) > { > puts ("cannot create socket in client"); > return NULL;
On 27 April 2014 17:02, Ondřej Bílka <neleai@seznam.cz> wrote: > Hi, as described in > > https://sourceware.org/bugzilla/show_bug.cgi?id=16876 > > relevant if test does not make sense as it tests if pointer is negative. > A clisock variable is unused outside of this test so we should fix it to > intended behaviour. > > OK to commit? > > > [BZ #16876] > * nptl/sockperf.c (client): Check if socket exist. "Check socket return value" would be clearer I think, but otherwise looks ok to me. > diff --git a/nptl/sockperf.c b/nptl/sockperf.c > index 740fb88..2d4b872 100644 > --- a/nptl/sockperf.c > +++ b/nptl/sockperf.c > @@ -71,7 +71,6 @@ client (void *arg) > struct thread_param *param = arg; > unsigned int cnt; > unsigned int nserv = param->nserv; > - int clisock[nserv]; > struct pollfd servpoll[nserv]; > struct sockaddr_un servaddr; > socklen_t servlen; > @@ -102,7 +101,7 @@ client (void *arg) > for (cnt = 0; cnt < nserv; ++cnt) > { > servpoll[cnt].fd = socket (AF_UNIX, SOCK_STREAM, 0); > - if (clisock < 0) > + if (servpoll[cnt].fd < 0) > { > puts ("cannot create socket in client"); > return NULL;
diff --git a/nptl/sockperf.c b/nptl/sockperf.c index 740fb88..2d4b872 100644 --- a/nptl/sockperf.c +++ b/nptl/sockperf.c @@ -71,7 +71,6 @@ client (void *arg) struct thread_param *param = arg; unsigned int cnt; unsigned int nserv = param->nserv; - int clisock[nserv]; struct pollfd servpoll[nserv]; struct sockaddr_un servaddr; socklen_t servlen; @@ -102,7 +101,7 @@ client (void *arg) for (cnt = 0; cnt < nserv; ++cnt) { servpoll[cnt].fd = socket (AF_UNIX, SOCK_STREAM, 0); - if (clisock < 0) + if (servpoll[cnt].fd < 0) { puts ("cannot create socket in client"); return NULL;