Unverified Commit 5f6e166b authored by Andy Pan's avatar Andy Pan Committed by GitHub
Browse files

Shrink code lines and reduce code cyclomatic complexity (#8748)

code cleanup in anetGenericAccept
parent 761d7d27
......@@ -493,18 +493,13 @@ int anetUnixServer(char *err, char *path, mode_t perm, int backlog)
static int anetGenericAccept(char *err, int s, struct sockaddr *sa, socklen_t *len) {
int fd;
while(1) {
do {
fd = accept(s,sa,len);
} while(fd == -1 && errno == EINTR);
if (fd == -1) {
if (errno == EINTR)
continue;
else {
anetSetError(err, "accept: %s", strerror(errno));
return ANET_ERR;
}
}
break;
}
return fd;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment