* fhandler_socket.cc (fhandler_socket::bind): Fix error code for

empty filename.
This commit is contained in:
Corinna Vinschen 2013-02-04 12:21:56 +00:00
parent 188fc1cf6e
commit cf4acdbc1f
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-02-04 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::bind): Fix error code for
empty filename.
2013-02-04 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::bind): Fix length check of

View File

@ -906,7 +906,7 @@ fhandler_socket::bind (const struct sockaddr *name, int namelen)
if (len <= 1 || len > UNIX_PATH_LEN
|| !memchr (un_addr->sun_path, '\0', len))
{
set_errno (len < 1 ? EINVAL : ENAMETOOLONG);
set_errno (len <= 1 ? (len == 1 ? ENOENT : EINVAL) : ENAMETOOLONG);
goto out;
}
sin.sin_family = AF_INET;