X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsys-sunos4.c;h=00f2ec521f5001006c091d7fa96970e84f361b07;hp=3e8d1ce7f303971ad80309560c0942e87109f6ab;hb=392a4f54cb25e48eed9cf5443febeeba7eaf7cbc;hpb=0429f850053952414c2a280dad902363965a7a3a diff --git a/pppd/sys-sunos4.c b/pppd/sys-sunos4.c index 3e8d1ce..00f2ec5 100644 --- a/pppd/sys-sunos4.c +++ b/pppd/sys-sunos4.c @@ -25,9 +25,7 @@ * OR MODIFICATIONS. */ -#ifndef lint -static char rcsid[] = "$Id: sys-sunos4.c,v 1.21 1999/05/12 06:15:58 paulus Exp $"; -#endif +#define RCSID "$Id: sys-sunos4.c,v 1.26 2001/03/12 22:59:00 paulus Exp $" #include #include @@ -67,6 +65,8 @@ extern void *alloca(); #endif #endif /*sparc*/ +static const char rcsid[] = RCSID; + static int pppfd; static int fdmuxid = -1; static int iffd; @@ -239,10 +239,10 @@ ppp_available() } /* - * establish_ppp - Turn the serial port into a ppp interface. + * tty_establish_ppp - Turn the serial port into a ppp interface. */ int -establish_ppp(fd) +tty_establish_ppp(fd) int fd; { int i; @@ -267,22 +267,13 @@ establish_ppp(fd) return pppfd; } -/* - * restore_loop - reattach the ppp unit to the loopback. - * This doesn't need to do anything because disestablish_ppp does it. - */ -void -restore_loop() -{ -} - /* * disestablish_ppp - Restore the serial port to normal operation. * It attempts to reconstruct the stream with the previously popped * modules. This shouldn't call die() because it's called from die(). */ void -disestablish_ppp(fd) +tty_disestablish_ppp(fd) int fd; { int i; @@ -614,8 +605,13 @@ wait_input(timo) int t; t = timo == NULL? -1: timo->tv_sec * 1000 + timo->tv_usec / 1000; - if (poll(pollfds, n_pollfds, t) < 0 && errno != EINTR) - fatal("poll: %m"); + if (poll(pollfds, n_pollfds, t) < 0 && errno != EINTR) { + if (errno != EAGAIN) + fatal("poll: %m"); + /* we can get EAGAIN on a heavily loaded system, + * just wait a short time and try again. */ + usleep(50000); + } } /* @@ -703,7 +699,7 @@ read_packet(buf) flags = 0; len = getmsg(pppfd, &ctrl, &data, &flags); if (len < 0) { - if (errno = EAGAIN || errno == EINTR) + if (errno == EAGAIN || errno == EINTR) return -1; fatal("Error reading packet: %m"); }