Cygwin: AF_UNIX: drop try/except block in bind method
The caller already does it anyway. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
be6da79713
commit
df14d97fff
|
@ -604,35 +604,29 @@ fhandler_socket_unix::socketpair (int af, int type, int protocol, int flags,
|
||||||
int
|
int
|
||||||
fhandler_socket_unix::bind (const struct sockaddr *name, int namelen)
|
fhandler_socket_unix::bind (const struct sockaddr *name, int namelen)
|
||||||
{
|
{
|
||||||
__try
|
|
||||||
{
|
|
||||||
sun_name_t sun (name, namelen);
|
sun_name_t sun (name, namelen);
|
||||||
bool unnamed = (sun.un_len == sizeof sun.un.sun_family);
|
bool unnamed = (sun.un_len == sizeof sun.un.sun_family);
|
||||||
HANDLE pipe = NULL;
|
HANDLE pipe = NULL;
|
||||||
|
|
||||||
if (get_handle ())
|
/* If we have a handle, we're already bound. */
|
||||||
|
if (get_handle () || sun.un.sun_family != AF_UNIX)
|
||||||
{
|
{
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
__leave;
|
return -1;
|
||||||
}
|
}
|
||||||
gen_pipe_name ();
|
gen_pipe_name ();
|
||||||
pipe = create_pipe ();
|
pipe = create_pipe ();
|
||||||
if (pipe)
|
if (!pipe)
|
||||||
{
|
return -1;
|
||||||
file = unnamed ? autobind (&sun) : create_file (&sun);
|
file = unnamed ? autobind (&sun) : create_file (&sun);
|
||||||
if (!file)
|
if (!file)
|
||||||
{
|
{
|
||||||
NtClose (pipe);
|
NtClose (pipe);
|
||||||
__leave;
|
return -1;
|
||||||
}
|
}
|
||||||
set_io_handle (pipe);
|
set_io_handle (pipe);
|
||||||
set_sun_path (&sun);
|
set_sun_path (&sun);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
}
|
|
||||||
__except (EFAULT) {}
|
|
||||||
__endtry
|
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in New Issue