free(client);
}
/* Accept connections on the local socket. */
- if (!FD_ISSET(ct->fd, &s->rfds))
- return;
- ret = para_accept(ct->fd, &unix_addr, sizeof(unix_addr));
- if (ret < 0) {
+ ret = para_accept(ct->fd, &s->rfds, &unix_addr, sizeof(unix_addr), &fd);
+ if (ret < 0)
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));
+ if (ret <= 0)
return;
- }
- fd = ret;
ret = mark_fd_nonblocking(fd);
if (ret < 0) {
PARA_NOTICE_LOG("%s\n", para_strerror(-ret));