Retern more appropriate errno when Linux path name is too long.

This commit is contained in:
jkim 2011-10-06 20:28:08 +00:00
parent cf76cae978
commit 55a4bbebe3

View File

@ -158,7 +158,7 @@ linux_getsockaddr(struct sockaddr **sap, const struct osockaddr *osa, int osalen
namelen = strnlen(((struct sockaddr_un *)kosa)->sun_path,
osalen - hdrlen);
if (hdrlen + namelen > sizeof(struct sockaddr_un)) {
error = EINVAL;
error = ENAMETOOLONG;
goto out;
}
alloclen = sizeof(struct sockaddr_un);