POLL_STDOUT
pfd[POLL_STDOUT].fd = stdout_fd;
pfd[POLL_STDOUT].events = 0;
if (pfd[POLL_NETOUT].fd == -1 && pfd[POLL_STDOUT].fd == -1)
if (pfd[POLL_STDOUT].revents & POLLHUP)
pfd[POLL_STDOUT].fd = -1;
if (pfd[POLL_STDOUT].fd == -1) {
pfd[POLL_STDOUT].events = POLLOUT;
if (pfd[POLL_STDOUT].revents & POLLOUT && netinbufpos > 0) {
ret = drainbuf(pfd[POLL_STDOUT].fd, netinbuf,
pfd[POLL_STDOUT].events = POLLIN;
pfd[POLL_STDOUT].events = POLLOUT;
pfd[POLL_STDOUT].fd = -1;
pfd[POLL_STDOUT].events = 0;
pfd[POLL_STDOUT].fd = -1;