From patchwork Fri Jul 6 20:12:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Cr=C3=ADstian_Viana?= X-Patchwork-Id: 169537 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1509C2C01EA for ; Sat, 7 Jul 2012 06:13:06 +1000 (EST) Received: from localhost ([::1]:41419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SnEtj-0008JY-9m for incoming@patchwork.ozlabs.org; Fri, 06 Jul 2012 16:13:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60238) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SnEtc-0008JT-JZ for qemu-devel@nongnu.org; Fri, 06 Jul 2012 16:12:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SnEta-0003ji-Qm for qemu-devel@nongnu.org; Fri, 06 Jul 2012 16:12:56 -0400 Received: from e24smtp02.br.ibm.com ([32.104.18.86]:46455) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SnEta-0003id-Ev for qemu-devel@nongnu.org; Fri, 06 Jul 2012 16:12:54 -0400 Received: from /spool/local by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Jul 2012 17:12:42 -0300 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 6 Jul 2012 17:12:36 -0300 Received: from d24relay03.br.ibm.com (d24relay03.br.ibm.com [9.13.184.25]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id 192733520044 for ; Fri, 6 Jul 2012 16:12:34 -0400 (EDT) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay03.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q66KBsKw27263210 for ; Fri, 6 Jul 2012 17:11:54 -0300 Received: from d24av04.br.ibm.com (loopback [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q66ICN1h029263 for ; Fri, 6 Jul 2012 15:12:24 -0300 Received: from jellybean.ibm.com (maritab.br.ibm.com [9.18.200.9] (may be forged)) by d24av04.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id q66ICMp6029218; Fri, 6 Jul 2012 15:12:22 -0300 From: =?UTF-8?q?Cr=C3=ADstian=20Viana?= To: QEMU Development ML Date: Fri, 6 Jul 2012 17:12:26 -0300 Message-Id: <1341605546-3774-1-git-send-email-vianac@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12070620-2194-0000-0000-00000267933B X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 32.104.18.86 Cc: Michael Roth , Anthony Liguori , =?UTF-8?q?Cr=C3=ADstian=20Viana?= Subject: [Qemu-devel] [PATCH 1/1] Remove unnecessary strlen in qga/channel-posix.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The third parameter of unix_listen in the line: int fd = unix_listen(path, NULL, strlen(path)); makes an unnecessary call to strlen. That parameter will not be used unless the second parameter is not NULL, which is not the case here. --- qga/channel-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/channel-posix.c b/qga/channel-posix.c index 57eea06..ba9c8a6 100644 --- a/qga/channel-posix.c +++ b/qga/channel-posix.c @@ -181,7 +181,7 @@ static gboolean ga_channel_open(GAChannel *c, const gchar *path, GAChannelMethod break; } case GA_CHANNEL_UNIX_LISTEN: { - int fd = unix_listen(path, NULL, strlen(path)); + int fd = unix_listen(path, NULL, 0); if (fd == -1) { g_critical("error opening path: %s", strerror(errno)); return false;