qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 1/1] Remove unnecessary strlen in qga/channel-posix.


From: Crístian Viana
Subject: [Qemu-devel] [PATCH 1/1] Remove unnecessary strlen in qga/channel-posix.c
Date: Fri, 6 Jul 2012 17:12:26 -0300

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]