From b808f80b90568dd9292f9f7501a6ecd9582e7790 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 24 Apr 2014 17:03:07 +0200 Subject: While ANET_ERR is -1, check syscall retval for -1 itself. --- src/anet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/anet.c b/src/anet.c index 2851318e2..935bcf478 100644 --- a/src/anet.c +++ b/src/anet.c @@ -472,7 +472,7 @@ int anetTcpAccept(char *err, int s, char *ip, size_t ip_len, int *port) { int fd; struct sockaddr_storage sa; socklen_t salen = sizeof(sa); - if ((fd = anetGenericAccept(err,s,(struct sockaddr*)&sa,&salen)) == ANET_ERR) + if ((fd = anetGenericAccept(err,s,(struct sockaddr*)&sa,&salen)) == -1) return ANET_ERR; if (sa.ss_family == AF_INET) { @@ -491,7 +491,7 @@ int anetUnixAccept(char *err, int s) { int fd; struct sockaddr_un sa; socklen_t salen = sizeof(sa); - if ((fd = anetGenericAccept(err,s,(struct sockaddr*)&sa,&salen)) == ANET_ERR) + if ((fd = anetGenericAccept(err,s,(struct sockaddr*)&sa,&salen)) == -1) return ANET_ERR; return fd; -- cgit v1.2.1