diff --git a/usr.sbin/pppctl/pppctl.c b/usr.sbin/pppctl/pppctl.c index e86033ca5e96..253983c832d0 100644 --- a/usr.sbin/pppctl/pppctl.c +++ b/usr.sbin/pppctl/pppctl.c @@ -6,12 +6,13 @@ #include #include +#include #include -#include #include #include #include #include +#include #include #define LINELEN 2048 @@ -135,13 +136,14 @@ static void check_fd(int sig) { if (data != -1) { - struct pollfd p; + struct timeval t; + fd_set f; static char buf[LINELEN]; - p.fd = data; - p.events = POLLIN|POLLPRI; - p.revents = p.events|POLLOUT; - if (poll(&p, 1, 0) > 0) + FD_ZERO(&f); + FD_SET(data, &f); + t.tv_sec = t.tv_usec = 0; + if (select(data+1, &f, NULL, NULL, &t) > 0) write(1, buf, read(data, buf, sizeof buf)); } }