diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-01-04 15:28:57 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-05-30 07:50:04 +0200 |
commit | d98b55ffc2ff634e65405d58cac9e0324124c700 (patch) | |
tree | 76c4fd12288c41b8584a745e861a801a5c527b4a /src/libelogind/sd-bus | |
parent | 5a98bb37ef28a1a0cfcb6676c469982d47997287 (diff) |
bus-socket: slight simplification in bus_get_peercred()
Diffstat (limited to 'src/libelogind/sd-bus')
-rw-r--r-- | src/libelogind/sd-bus/bus-socket.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/libelogind/sd-bus/bus-socket.c b/src/libelogind/sd-bus/bus-socket.c index f930ba93f..bc64779d3 100644 --- a/src/libelogind/sd-bus/bus-socket.c +++ b/src/libelogind/sd-bus/bus-socket.c @@ -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) { |