qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/1] Remove unnecessary strlen in qga/channel-posix.c
@ 2012-07-06 20:12 Crístian Viana
  0 siblings, 0 replies; only message in thread
From: Crístian Viana @ 2012-07-06 20:12 UTC (permalink / raw)
  To: QEMU Development ML; +Cc: Michael Roth, Anthony Liguori, Crístian Viana

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-06 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-06 20:12 [Qemu-devel] [PATCH 1/1] Remove unnecessary strlen in qga/channel-posix.c Crístian Viana

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).