From 93b2bde457ac91bd4a395dfafd6bd5eed670c85a Mon Sep 17 00:00:00 2001 From: Paul Mackerras Date: Tue, 13 Jan 2004 04:12:31 +0000 Subject: [PATCH] Check for EAGAIN as well as EWOULDBLOCK, since they are different under Linux on parisc. --- pppd/sys-linux.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/pppd/sys-linux.c b/pppd/sys-linux.c index effb638..68e0584 100644 --- a/pppd/sys-linux.c +++ b/pppd/sys-linux.c @@ -1025,7 +1025,7 @@ void output (int unit, unsigned char *p, int len) fd = ppp_dev_fd; } if (write(fd, p, len) < 0) { - if (errno == EWOULDBLOCK || errno == ENOBUFS + if (errno == EWOULDBLOCK || errno == EAGAIN || errno == ENOBUFS || errno == ENXIO || errno == EIO || errno == EINTR) warn("write: warning: %m (%d)", errno); else @@ -1091,7 +1091,8 @@ int read_packet (unsigned char *buf) nr = -1; if (ppp_fd >= 0) { nr = read(ppp_fd, buf, len); - if (nr < 0 && errno != EWOULDBLOCK && errno != EIO && errno != EINTR) + if (nr < 0 && errno != EWOULDBLOCK && errno != EAGAIN + && errno != EIO && errno != EINTR) error("read: %m"); if (nr < 0 && errno == ENXIO) return 0; @@ -1099,7 +1100,8 @@ int read_packet (unsigned char *buf) if (nr < 0 && new_style_driver && ppp_dev_fd >= 0) { /* N.B. we read ppp_fd first since LCP packets come in there. */ nr = read(ppp_dev_fd, buf, len); - if (nr < 0 && errno != EWOULDBLOCK && errno != EIO && errno != EINTR) + if (nr < 0 && errno != EWOULDBLOCK && errno != EAGAIN + && errno != EIO && errno != EINTR) error("read /dev/ppp: %m"); if (nr < 0 && errno == ENXIO) return 0; @@ -1133,7 +1135,7 @@ get_loop_output(void) if (n == 0) fatal("eof on loopback"); - if (errno != EWOULDBLOCK) + if (errno != EWOULDBLOCK && errno != EAGAIN) fatal("read from loopback: %m(%d)", errno); return rv; -- 2.39.2