From mboxrd@z Thu Jan 1 00:00:00 1970 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 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 From: =?UTF-8?q?Cr=C3=ADstian=20Viana?= Date: Fri, 6 Jul 2012 17:12:26 -0300 Message-Id: <1341605546-3774-1-git-send-email-vianac@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 1/1] Remove unnecessary strlen in qga/channel-posix.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Development ML Cc: Michael Roth , Anthony Liguori , =?UTF-8?q?Cr=C3=ADstian=20Viana?= 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; -- 1.7.9.5