]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bus-socket: slight simplification in bus_get_peercred() 7833/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 4 Jan 2018 14:28:57 +0000 (15:28 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 11 Jan 2018 12:04:11 +0000 (13:04 +0100)
src/libsystemd/sd-bus/bus-socket.c

index 61539313bcec94f7b33c6fae9cb630160c1c7d1a..4eaecffa8561e62f6f58ef2a13257bf52998ad2c 100644 (file)
@@ -620,13 +620,10 @@ static void bus_get_peercred(sd_bus *b) {
 
         /* Get the list of auxiliary groups of the peer */
         r = getpeergroups(b->input_fd, &b->groups);
-        if (r < 0) {
-                if (!IN_SET(r, -EOPNOTSUPP, -ENOPROTOOPT))
-                        log_debug_errno(r, "Failed to determine peer groups list: %m");
-
-                b->n_groups = (size_t) -1;
-        } else
+        if (r >= 0)
                 b->n_groups = (size_t) r;
+        else if (!IN_SET(r, -EOPNOTSUPP, -ENOPROTOOPT))
+                log_debug_errno(r, "Failed to determine peer's group list: %m");
 }
 
 static int bus_socket_start_auth_client(sd_bus *b) {