#include "fatal-signal.h"
#include "poll-loop.h"
#include "socket-util.h"
+#include "timeval.h"
#include "util.h"
#include "vlog.h"
pfd.fd = client->fd;
pfd.events = POLLIN;
- nfds = poll(&pfd, 1, 1000);
+ nfds = time_poll(&pfd, 1, 1000);
if (nfds == 0) {
return ETIMEDOUT;
} else if (nfds < 0) {
- return errno;
+ return -nfds;
}
nbytes = read(client->fd, buffer, sizeof buffer - 1);