Author: ume
Date: Tue Oct 5 15:40:59 2010
New Revision: 213453
URL: http://svn.freebsd.org/changeset/base/213453
Log:
When no protocol entry is found, getproto*_r(3) should
return zero.
Spotted by: Kostik Belousov <kostikbel__at__gmail.com>
MFC after: 2 weeks
Modified:
head/lib/libc/net/getproto.c
head/lib/libc/net/getprotoent.c
head/lib/libc/net/getprotoname.c
Modified: head/lib/libc/net/getproto.c
==============================================================================
--- head/lib/libc/net/getproto.c Tue Oct 5 15:31:56 2010
(r213452)
+++ head/lib/libc/net/getproto.c Tue Oct 5 15:40:59 2010
(r213453)
@@ -123,7 +123,7 @@ getprotobynumber_r(int proto, struct pro
if (rv != NS_SUCCESS) {
errno = ret_errno;
- return ((ret_errno != 0) ? ret_errno : -1);
+ return (ret_errno);
}
return (0);
}
Modified: head/lib/libc/net/getprotoent.c
==============================================================================
--- head/lib/libc/net/getprotoent.c Tue Oct 5 15:31:56 2010
(r213452)
+++ head/lib/libc/net/getprotoent.c Tue Oct 5 15:40:59 2010
(r213453)
@@ -494,7 +494,7 @@ getprotoent_r(struct protoent *pptr, cha
if (rv != NS_SUCCESS) {
errno = ret_errno;
- return ((ret_errno != 0) ? ret_errno : -1);
+ return (ret_errno);
}
return (0);
}
Modified: head/lib/libc/net/getprotoname.c
==============================================================================
--- head/lib/libc/net/getprotoname.c Tue Oct 5 15:31:56 2010
(r213452)
+++ head/lib/libc/net/getprotoname.c Tue Oct 5 15:40:59 2010
(r213453)
@@ -131,7 +131,7 @@ getprotobyname_r(const char *name, struc
if (rv != NS_SUCCESS) {
errno = ret_errno;
- return ((ret_errno != 0) ? ret_errno : -1);
+ return (ret_errno);
}
return (0);
}
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"