chiark / gitweb /
bus: fix parsing of AcquireName() response
authorLennart Poettering <lennart@poettering.net>
Tue, 3 Dec 2013 19:31:34 +0000 (20:31 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 3 Dec 2013 19:31:34 +0000 (20:31 +0100)
src/libsystemd-bus/bus-control.c

index d98a4dd..7a772ff 100644 (file)
@@ -110,10 +110,10 @@ static int bus_request_name_dbus1(sd_bus *bus, const char *name, unsigned flags)
                 return -EEXIST;
         else if (ret == BUS_NAME_IN_QUEUE)
                 return 0;
-        else
-                return -EIO;
+        else if (ret == BUS_NAME_PRIMARY_OWNER)
+                return 1;
 
-        return 1;
+        return -EIO;
 }
 
 _public_ int sd_bus_request_name(sd_bus *bus, const char *name, unsigned flags) {