X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmain.c;h=0722e9104076417b68500f16058a98f31f1e8f2d;hp=d5c4d131313800da92072ed688079cf9a0ea9fd3;hb=9b7089a0401b5d0973cace08f1f632d526a06377;hpb=2b0e16c59c832c53545eba4ad3b2857334c1b2ff diff --git a/pppd/main.c b/pppd/main.c index d5c4d13..0722e91 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: main.c,v 1.97 2000/04/24 02:54:16 masputra Exp $" +#define RCSID "$Id: main.c,v 1.98 2000/04/29 12:32:59 paulus Exp $" #include #include @@ -2417,12 +2417,13 @@ charshunt(ifd, ofd, record_file) n = max_level - olevel; n = write(ofd, obufp, n); if (n < 0) { - if (errno != EIO) { + if (errno == EIO) { + pty_readable = 0; + nobuf = 0; + } else if (errno != EAGAIN && errno != EINTR) { error("Error writing standard output: %m"); break; } - pty_readable = 0; - nobuf = 0; } else { obufp += n; nobuf -= n; @@ -2435,12 +2436,13 @@ charshunt(ifd, ofd, record_file) n = max_level - ilevel; n = write(pty_master, ibufp, n); if (n < 0) { - if (errno != EIO) { + if (errno == EIO) { + stdin_readable = 0; + nibuf = 0; + } else if (errno != EAGAIN && errno != EINTR) { error("Error writing pseudo-tty master: %m"); break; } - stdin_readable = 0; - nibuf = 0; } else { ibufp += n; nibuf -= n;