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>
This commit is contained in:
parent
9b0cc33d68
commit
8033a8e889
1 changed files with 1 additions and 1 deletions
2
util.c
2
util.c
|
@ -141,7 +141,7 @@ int sock_l4(const struct ctx *c, int af, uint8_t proto,
|
||||||
|
|
||||||
if (fd > SOCKET_MAX) {
|
if (fd > SOCKET_MAX) {
|
||||||
close(fd);
|
close(fd);
|
||||||
return -EIO;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ref.r.s = fd;
|
ref.r.s = fd;
|
||||||
|
|
Loading…
Reference in a new issue