chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a98bb3
)
bus-socket: slight simplification in bus_get_peercred()
author
Zbigniew Jędrzejewski-Szmek
<zbyszek@in.waw.pl>
Thu, 4 Jan 2018 14:28:57 +0000
(15:28 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Wed, 30 May 2018 05:50:04 +0000
(07:50 +0200)
src/libelogind/sd-bus/bus-socket.c
patch
|
blob
|
history
diff --git
a/src/libelogind/sd-bus/bus-socket.c
b/src/libelogind/sd-bus/bus-socket.c
index f930ba93fc999ba7e53e7cf3636b919aae061d69..bc64779d356db01345c6f1639ee3f0d3ebd6abb9 100644
(file)
--- 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) {