From 4b41eebeb27051c9e6fb32291a560130ff7a0a96 Mon Sep 17 00:00:00 2001 From: lzmths Date: Mon, 14 Dec 2015 11:04:00 -0300 Subject: Refactoring conditional directives that break parts of statements. --- evutil.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'evutil.c') diff --git a/evutil.c b/evutil.c index f9cbaa7d..3c38cda1 100644 --- a/evutil.c +++ b/evutil.c @@ -226,16 +226,17 @@ evutil_ersatz_socketpair_(int family, int type, int protocol, struct sockaddr_in connect_addr; ev_socklen_t size; int saved_errno = -1; - - if (protocol - || (family != AF_INET + int family_test; + + family_test = family != AF_INET; #ifdef AF_UNIX - && family != AF_UNIX + family_test = family_test && (family != AF_UNIX); #endif - )) { + if (protocol || family_test) { EVUTIL_SET_SOCKET_ERROR(ERR(EAFNOSUPPORT)); return -1; } + if (!fd) { EVUTIL_SET_SOCKET_ERROR(ERR(EINVAL)); return -1; -- cgit v1.2.1