mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Merge pull request #296 from lzmths/master
Refactoring conditional directives that break parts of statements.
This commit is contained in:
commit
1c17cfdd2b
11
evutil.c
11
evutil.c
@ -226,16 +226,17 @@ evutil_ersatz_socketpair_(int family, int type, int protocol,
|
|||||||
struct sockaddr_in connect_addr;
|
struct sockaddr_in connect_addr;
|
||||||
ev_socklen_t size;
|
ev_socklen_t size;
|
||||||
int saved_errno = -1;
|
int saved_errno = -1;
|
||||||
|
int family_test;
|
||||||
if (protocol
|
|
||||||
|| (family != AF_INET
|
family_test = family != AF_INET;
|
||||||
#ifdef AF_UNIX
|
#ifdef AF_UNIX
|
||||||
&& family != AF_UNIX
|
family_test = family_test && (family != AF_UNIX);
|
||||||
#endif
|
#endif
|
||||||
)) {
|
if (protocol || family_test) {
|
||||||
EVUTIL_SET_SOCKET_ERROR(ERR(EAFNOSUPPORT));
|
EVUTIL_SET_SOCKET_ERROR(ERR(EAFNOSUPPORT));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fd) {
|
if (!fd) {
|
||||||
EVUTIL_SET_SOCKET_ERROR(ERR(EINVAL));
|
EVUTIL_SET_SOCKET_ERROR(ERR(EINVAL));
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user