Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a9fefbce
Commit
a9fefbce
authored
Mar 07, 2017
by
vienna
Committed by
antirez
Apr 18, 2017
Browse files
fix #3847: add close socket before return ANET_ERR.
parent
17250409
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/anet.c
View file @
a9fefbce
...
@@ -380,8 +380,10 @@ int anetUnixGenericConnect(char *err, char *path, int flags)
...
@@ -380,8 +380,10 @@ int anetUnixGenericConnect(char *err, char *path, int flags)
sa
.
sun_family
=
AF_LOCAL
;
sa
.
sun_family
=
AF_LOCAL
;
strncpy
(
sa
.
sun_path
,
path
,
sizeof
(
sa
.
sun_path
)
-
1
);
strncpy
(
sa
.
sun_path
,
path
,
sizeof
(
sa
.
sun_path
)
-
1
);
if
(
flags
&
ANET_CONNECT_NONBLOCK
)
{
if
(
flags
&
ANET_CONNECT_NONBLOCK
)
{
if
(
anetNonBlock
(
err
,
s
)
!=
ANET_OK
)
if
(
anetNonBlock
(
err
,
s
)
!=
ANET_OK
)
{
close
(
s
);
return
ANET_ERR
;
return
ANET_ERR
;
}
}
}
if
(
connect
(
s
,(
struct
sockaddr
*
)
&
sa
,
sizeof
(
sa
))
==
-
1
)
{
if
(
connect
(
s
,(
struct
sockaddr
*
)
&
sa
,
sizeof
(
sa
))
==
-
1
)
{
if
(
errno
==
EINPROGRESS
&&
if
(
errno
==
EINPROGRESS
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment