aboutgitcodebugslistschat
path: root/util.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-11-17 16:59:07 +1100
committerStefano Brivio <sbrivio@redhat.com>2022-11-25 01:36:01 +0100
commit8033a8e889ef5893aeab156fd9a60cd4d5722e48 (patch)
tree718476f36f688f2677fc7ed9931eb50e4673c678 /util.c
parent9b0cc33d6841bec78e1896d4cd1761a57bd250a7 (diff)
downloadpasst-8033a8e889ef5893aeab156fd9a60cd4d5722e48.tar
passt-8033a8e889ef5893aeab156fd9a60cd4d5722e48.tar.gz
passt-8033a8e889ef5893aeab156fd9a60cd4d5722e48.tar.bz2
passt-8033a8e889ef5893aeab156fd9a60cd4d5722e48.tar.lz
passt-8033a8e889ef5893aeab156fd9a60cd4d5722e48.tar.xz
passt-8033a8e889ef5893aeab156fd9a60cd4d5722e48.tar.zst
passt-8033a8e889ef5893aeab156fd9a60cd4d5722e48.zip
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 <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'util.c')
-rw-r--r--util.c2
1 files changed, 1 insertions, 1 deletions
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;