diff options
author | Pino Toscano <toscano.pino@tiscali.it> | 2010-10-11 17:07:53 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2010-10-11 18:11:43 +0200 |
commit | 0b32d1eb64aeb9684b4f0800f9c1fdbe5d6c7b00 (patch) | |
tree | 203e4198b95cf57234dce54def83d87fe224888a | |
parent | 22bc9da3dd61c6b12f8d03946ef75ec9cfb88a22 (diff) |
Fix return value on `getname' errors.
This fixes the errno return value for getpeername() calls on not connected
sockets: the return value of the `getname' call comes from the Linux code, so it
is a negative value, in case of error.
* pfinet/misc.c (make_sockaddr_port): Turn negative error values returned by
`getname' calls into positive values before returning it.
-rw-r--r-- | pfinet/misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pfinet/misc.c b/pfinet/misc.c index 56611daf..08b19e9b 100644 --- a/pfinet/misc.c +++ b/pfinet/misc.c @@ -42,7 +42,7 @@ make_sockaddr_port (struct socket *sock, err = (*sock->ops->getname) (sock, &buf.sa, &buflen, peer); if (err) - return err; + return -err; err = ports_create_port (addrport_class, pfinet_bucket, (offsetof (struct sock_addr, address) |