diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index 507a599d7c..e0b959f5da 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -14,6 +14,7 @@ #include #include +#include "errno-util.h" #include "macro.h" #include "missing_network.h" #include "missing_socket.h" @@ -264,7 +265,7 @@ static inline int getsockopt_int(int fd, int level, int optname, int *ret) { socklen_t sl = sizeof(v); if (getsockopt(fd, level, optname, &v, &sl) < 0) - return -errno; + return negative_errno(); if (sl != sizeof(v)) return -EIO;