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 <david(a)gibson.dropbear.id.au> --- 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; -- 2.38.1