socklen_t len = sizeof(addr);
uv_os_sock_t fd = accept4(listener->fd, (struct sockaddr *)&addr, &len, SOCK_CLOEXEC | SOCK_NONBLOCK);
if (fd == -1) {
- if (!net_wouldblock())
+ if (errno != EAGAIN && errno != EWOULDBLOCK)
perror("accept4");
break;
}
return;
// Error
case -1:
- if(!net_wouldblock()){
+ if (errno != EAGAIN && errno != EWOULDBLOCK) {
perror("recv");
killConnection(cl, 0);
} else {
if (!rv)
return -1;
if (rv == -1) {
- if (net_wouldblock()) {
+ if (errno == EAGAIN || errno == EWOULDBLOCK) {
cl->want_write_for_write = 1;
return len;
} else {
#include <netdb.h>
#include <fcntl.h>
#include <signal.h>
-#define net_wouldblock() (errno == EAGAIN || errno == EWOULDBLOCK)
#endif