diff options
author | Hajimu UMEMOTO <ume@FreeBSD.org> | 2010-10-05 15:40:59 +0000 |
---|---|---|
committer | Hajimu UMEMOTO <ume@FreeBSD.org> | 2010-10-05 15:40:59 +0000 |
commit | c618a8562e68d7315c7107a6ad84f2faf7cc7b9c (patch) | |
tree | 921c28561025b683feaf1dfb4333196b3b5e2639 | |
parent | 3f506a78ced7af0e7a3a085d6cd37ce62bf5f68c (diff) | |
download | src-c618a8562e68d7315c7107a6ad84f2faf7cc7b9c.tar.gz src-c618a8562e68d7315c7107a6ad84f2faf7cc7b9c.zip |
When no protocol entry is found, getproto*_r(3) should
return zero.
Spotted by: Kostik Belousov <kostikbel__at__gmail.com>
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=213453
-rw-r--r-- | lib/libc/net/getproto.c | 2 | ||||
-rw-r--r-- | lib/libc/net/getprotoent.c | 2 | ||||
-rw-r--r-- | lib/libc/net/getprotoname.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/net/getproto.c b/lib/libc/net/getproto.c index cb3a3ed942d3..b923edf18a99 100644 --- a/lib/libc/net/getproto.c +++ b/lib/libc/net/getproto.c @@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct protoent *pptr, char *buffer, if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } diff --git a/lib/libc/net/getprotoent.c b/lib/libc/net/getprotoent.c index ccd5e1216489..0cfca458898f 100644 --- a/lib/libc/net/getprotoent.c +++ b/lib/libc/net/getprotoent.c @@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, char *buffer, size_t buflen, if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } diff --git a/lib/libc/net/getprotoname.c b/lib/libc/net/getprotoname.c index 08822c18d4d8..22c57594f6db 100644 --- a/lib/libc/net/getprotoname.c +++ b/lib/libc/net/getprotoname.c @@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struct protoent *pptr, char *buffer, if (rv != NS_SUCCESS) { errno = ret_errno; - return ((ret_errno != 0) ? ret_errno : -1); + return (ret_errno); } return (0); } |