tree-wide: drop assignments to r when we only need errno
If the whole call is simple and we don't need to look at the return value apart from the conditional, let's use a form without assignment of the return value. When the function call is more complicated, it still makes sense to use a temporary variable.
This commit is contained in:
+1
-2
@@ -526,8 +526,7 @@ int socket_acquire_peer(Socket *s, int fd, SocketPeer **p) {
|
||||
assert(fd >= 0);
|
||||
assert(s);
|
||||
|
||||
r = getpeername(fd, &sa.peer.sa, &salen);
|
||||
if (r < 0)
|
||||
if (getpeername(fd, &sa.peer.sa, &salen) < 0)
|
||||
return log_unit_error_errno(UNIT(s), errno, "getpeername failed: %m");
|
||||
|
||||
if (!IN_SET(sa.peer.sa.sa_family, AF_INET, AF_INET6, AF_VSOCK)) {
|
||||
|
||||
Reference in New Issue
Block a user