From 8033a8e889ef5893aeab156fd9a60cd4d5722e48 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 17 Nov 2022 16:59:07 +1100 Subject: util: Always return -1 on error in sock_l4() According to its doc comments, sock_l4() returns -1 on error. It does, except in one case where it returns -EIO. Fix this inconsistency to match the docs and always return -1. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 59c6641..d9858f2 100644 --- a/util.c +++ b/util.c @@ -141,7 +141,7 @@ int sock_l4(const struct ctx *c, int af, uint8_t proto, if (fd > SOCKET_MAX) { close(fd); - return -EIO; + return -1; } ref.r.s = fd; -- cgit v1.2.3