diff options
author | ume <ume@FreeBSD.org> | 2010-10-05 15:40:59 +0000 |
---|---|---|
committer | ume <ume@FreeBSD.org> | 2010-10-05 15:40:59 +0000 |
commit | c14c65c26a7679c30028d9af7387a3b65f037908 (patch) | |
tree | 921c28561025b683feaf1dfb4333196b3b5e2639 /lib/libc/net/getprotoname.c | |
parent | 4c0eac49f2933c9c6461636636d764d0129c6265 (diff) | |
download | FreeBSD-src-c14c65c26a7679c30028d9af7387a3b65f037908.zip FreeBSD-src-c14c65c26a7679c30028d9af7387a3b65f037908.tar.gz |
When no protocol entry is found, getproto*_r(3) should
return zero.
Spotted by: Kostik Belousov <kostikbel__at__gmail.com>
MFC after: 2 weeks
Diffstat (limited to 'lib/libc/net/getprotoname.c')
-rw-r--r-- | lib/libc/net/getprotoname.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/net/getprotoname.c b/lib/libc/net/getprotoname.c index 08822c1..22c5759 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); } |