]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
util: simplify unix_listen()
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Fri, 3 May 2019 13:00:33 +0000 (15:00 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Fri, 10 May 2019 12:54:11 +0000 (14:54 +0200)
The only caller of unix_listen() left is qga/channel-posix.c.

There is no need to deal with legacy coma-trailing options ",...".

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-id: 20190503130034.24916-6-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
util/qemu-sockets.c

index ba6335e71a95188c7e3e42d6dc93586bbbfd67cd..8850a280a84bc491f5509e40ff67fc9ddfec82ef 100644 (file)
@@ -970,26 +970,12 @@ static int unix_connect_saddr(UnixSocketAddress *saddr, Error **errp)
 /* compatibility wrapper */
 int unix_listen(const char *str, Error **errp)
 {
-    char *path, *optstr;
-    int sock, len;
     UnixSocketAddress *saddr;
+    int sock;
 
     saddr = g_new0(UnixSocketAddress, 1);
-
-    optstr = strchr(str, ',');
-    if (optstr) {
-        len = optstr - str;
-        if (len) {
-            path = g_malloc(len+1);
-            snprintf(path, len+1, "%.*s", len, str);
-            saddr->path = path;
-        }
-    } else {
-        saddr->path = g_strdup(str);
-    }
-
+    saddr->path = g_strdup(str);
     sock = unix_listen_saddr(saddr, errp);
-
     qapi_free_UnixSocketAddress(saddr);
     return sock;
 }