1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 03:25:27 +03:00

socket-util: Run the fallback when the kernel complains about the null buffer (#3541)

Calling recv with a NULL buffer returns EFAULT instead of EOPNOTSUPP on
older kernels (3.14).

Fixes #3407

Signed-off-by: Kai Ruhnau <kai.ruhnau@target-sg.com>
This commit is contained in:
Kai Ruhnau 2016-06-15 12:33:24 +02:00 committed by Lennart Poettering
parent 7d38158b5d
commit 77d4acf332

View File

@ -986,7 +986,7 @@ ssize_t next_datagram_size_fd(int fd) {
l = recv(fd, NULL, 0, MSG_PEEK|MSG_TRUNC);
if (l < 0) {
if (errno == EOPNOTSUPP)
if (errno == EOPNOTSUPP || errno == EFAULT)
goto fallback;
return -errno;