]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/socket: use ERROR_IS_NEG_* at one more place
authorMike Yuan <me@yhndnzj.com>
Fri, 16 May 2025 16:17:18 +0000 (18:17 +0200)
committerMike Yuan <me@yhndnzj.com>
Mon, 30 Jun 2025 10:44:54 +0000 (12:44 +0200)
src/core/socket.c

index e5cff0de7610518042ad06497f0ab01c9b7cdf6c..1765e6f9c6af6cf8b739f88ecc77ed28c3bd2994 100644 (file)
@@ -2412,12 +2412,11 @@ static void socket_enter_running(Socket *s, int cfd_in) {
 
                 if (s->max_connections_per_source > 0) {
                         r = socket_acquire_peer(s, cfd, &p);
-                        if (r < 0) {
-                                if (ERRNO_IS_DISCONNECT(r))
-                                        return;
+                        if (ERRNO_IS_NEG_DISCONNECT(r))
+                                return;
+                        if (r < 0)
                                 /* We didn't have enough resources to acquire peer information, let's fail. */
                                 goto fail;
-                        }
                         if (r > 0 && p->n_ref > s->max_connections_per_source) {
                                 _cleanup_free_ char *t = NULL;