]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-daemon: downgrade log level for library code, use correct errno 32520/head
authorMike Yuan <me@yhndnzj.com>
Sat, 27 Apr 2024 11:34:45 +0000 (19:34 +0800)
committerMike Yuan <me@yhndnzj.com>
Sat, 27 Apr 2024 11:38:16 +0000 (19:38 +0800)
Follow-up for 13b67b61b3b4a5356f5d1b29b51137b8e336aa55

src/libsystemd/sd-daemon/sd-daemon.c

index 16a8ac6cce157967b1d6cfb1b2b1ae574a9b7ee4..4945d821501e563a9690ca34e82058332a3c212b 100644 (file)
@@ -595,14 +595,14 @@ static int pid_notify_with_fds_internal(
         if (address.sockaddr.sa.sa_family == AF_VSOCK && IN_SET(type, SOCK_STREAM, SOCK_SEQPACKET)) {
                 /* For AF_VSOCK, we need to close the socket to signal the end of the message. */
                 if (shutdown(fd, SHUT_WR) < 0)
-                        return log_error_errno(errno, "Failed to shutdown notify socket: %m");
+                        return log_debug_errno(errno, "Failed to shutdown notify socket: %m");
 
-                char buf[1];
-                n = recv(fd, buf, sizeof(buf), MSG_NOSIGNAL);
-                if (n > 0)
-                        return log_error_errno(errno, "Unexpectedly received data on notify socket: %m");
+                char c;
+                n = recv(fd, &c, sizeof(c), MSG_NOSIGNAL);
                 if (n < 0)
-                        return log_error_errno(errno, "Failed to wait for EOF on notify socket: %m");
+                        return log_debug_errno(errno, "Failed to wait for EOF on notify socket: %m");
+                if (n > 0)
+                        return log_debug_errno(SYNTHETIC_ERRNO(EPROTO), "Unexpectedly received data on notify socket.");
         }
 
         return 1;