1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-11 09:18:07 +03:00

sd-daemon: downgrade log level for library code, use correct errno

Follow-up for 13b67b61b3
This commit is contained in:
Mike Yuan 2024-04-27 19:34:45 +08:00
parent 3e9fcc2163
commit 3baab23b25
No known key found for this signature in database
GPG Key ID: 417471C0A40F58B3

View 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)) { 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. */ /* For AF_VSOCK, we need to close the socket to signal the end of the message. */
if (shutdown(fd, SHUT_WR) < 0) 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]; char c;
n = recv(fd, buf, sizeof(buf), MSG_NOSIGNAL); n = recv(fd, &c, sizeof(c), MSG_NOSIGNAL);
if (n > 0)
return log_error_errno(errno, "Unexpectedly received data on notify socket: %m");
if (n < 0) 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; return 1;