When no protocol entry is found, getproto*_r(3) should

return zero.

Spotted by:	Kostik Belousov <kostikbel__at__gmail.com>
MFC after:	2 weeks
This commit is contained in:
Hajimu UMEMOTO 2010-10-05 15:40:59 +00:00
parent 3f506a78ce
commit c618a8562e
3 changed files with 3 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}