| 871 |
for (int i = 0; i < nfds; i++) |
for (int i = 0; i < nfds; i++) |
| 872 |
{ |
{ |
| 873 |
#ifdef HAVE_SYS_EPOLL_H |
#ifdef HAVE_SYS_EPOLL_H |
| 874 |
if (events[i].data.fd == STDIN_FILENO) |
if (events[i].events & (EPOLLRDHUP | EPOLLHUP | EPOLLERR)) |
| 875 |
|
#else |
| 876 |
|
if (pfds[i].revents & (POLLRDHUP | POLLHUP | POLLERR)) |
| 877 |
|
#endif |
| 878 |
|
{ |
| 879 |
|
#ifdef _DEBUG |
| 880 |
|
#ifdef HAVE_SYS_EPOLL_H |
| 881 |
|
log_error("FD (%d) error events (%d)\n", events[i].data.fd, events[i].events); |
| 882 |
|
#else |
| 883 |
|
log_error("FD (%d) error events (%d)\n", pfds[i].fd, pfds[i].revents); |
| 884 |
|
#endif |
| 885 |
|
#endif |
| 886 |
|
loop = 0; |
| 887 |
|
break; |
| 888 |
|
} |
| 889 |
|
|
| 890 |
|
#ifdef HAVE_SYS_EPOLL_H |
| 891 |
|
if (events[i].data.fd == STDIN_FILENO && (events[i].events & EPOLLIN)) |
| 892 |
#else |
#else |
| 893 |
if (pfds[i].fd == STDIN_FILENO && (pfds[i].revents & POLLIN)) |
if (pfds[i].fd == STDIN_FILENO && (pfds[i].revents & POLLIN)) |
| 894 |
#endif |
#endif |
| 922 |
} |
} |
| 923 |
|
|
| 924 |
#ifdef HAVE_SYS_EPOLL_H |
#ifdef HAVE_SYS_EPOLL_H |
| 925 |
if (events[i].data.fd == STDOUT_FILENO) |
if (events[i].data.fd == STDOUT_FILENO && (events[i].events & EPOLLOUT)) |
| 926 |
#else |
#else |
| 927 |
if (pfds[i].fd == STDOUT_FILENO && (pfds[i].revents & POLLOUT)) |
if (pfds[i].fd == STDOUT_FILENO && (pfds[i].revents & POLLOUT)) |
| 928 |
#endif |
#endif |