From patchwork Sun Apr 27 16:02:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?T25kxZllaiBCw61sa2E=?= X-Patchwork-Id: 343168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 ozlabs.org (Postfix) with ESMTPS id 7533A1400A3 for ; Mon, 28 Apr 2014 02:03:48 +1000 (EST) 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=nWJAWShspuKqjS/c4ktl0pS2+a5rK BdT5M+jOSn91bBQaEN113v6UiYIruN8CcDsdHSOzHMzLouTS6h4o1Gb4b4qNxZyf P1c3oqPI21BbfCkf3nA6GjkAck6vF/cWyoRLWZxGcJwhG8X7lgMyXbNiQV17D39C ct0v5PV93VHoR8= 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=qAO gG9PkUqv0UKr8Ly35oI2MqpTETPGJqhgdw4as/LzRCrdigMVgZn+ykoZkL+RkR0m 3uaTSEyTFje+OjM/zfDQp3WMQzXDnT2fHLM+Kd912xz0JbfjxgkC+ZfTLxZYP4RM Il6Fau+AX4G2QfpPmmL4H0nrGjG0fj2J+DFuzbdQ= 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: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , 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=?= 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-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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;