From 74032403f5520a3878705466ddc777377a6cf825 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Wed, 26 Oct 1994 04:18:54 +0000 Subject: [PATCH] Check for both EAGAIN in addition to EWOULDBLOCK git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4575 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 6 ++++++ src/appl/bsd/krlogind.c | 14 +++++++------- src/appl/bsd/krsh.c | 8 ++++---- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 10aac3053..a8ad665d8 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,9 @@ +Wed Oct 26 00:04:02 1994 Theodore Y. Ts'o (tytso@dcl) + + * krsh.c (main): + * krlogind.c (protocol, v5_des_read): Check for both EAGAIN in + addition to EWOULDBLOCK. + Mon Oct 24 14:46:07 1994 (tytso@rsx-11) * Makefile.in: The Kerberos V4 libraries must be linked in after diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c index c087e499d..8f5634c01 100644 --- a/src/appl/bsd/krlogind.c +++ b/src/appl/bsd/krlogind.c @@ -944,7 +944,7 @@ protocol(f, p) } if (ibits & (1< 0) { cc = (*des_write)(f, pbp, pcc); - if (cc < 0 && errno == EWOULDBLOCK) { + if (cc < 0 && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) { /* also shouldn't happen */ sleep(5); continue; @@ -1247,9 +1247,9 @@ v5_des_read(fd, buf, len) if ((cc = krb5_net_read(fd, (char *)&rd_len, sizeof(rd_len))) != sizeof(rd_len)) { #endif - if ((cc < 0) && (errno == EWOULDBLOCK)) return(cc); - /* XXX can't read enough, pipe - must have closed */ + if ((cc < 0) && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) + return(cc); + /* XXX can't read enough, pipe must have closed */ return(0); } rd_len = ntohl(rd_len); @@ -1265,7 +1265,7 @@ v5_des_read(fd, buf, len) if ((cc = krb5_net_read(fd, desinbuf.data, net_len)) != net_len) { /* XXX can't read enough, pipe must have closed */ - if ((cc < 0) && (errno == EWOULDBLOCK)) { + if ((cc < 0) && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) { retry++; sleep(1); if (retry > MAXRETRIES){ diff --git a/src/appl/bsd/krsh.c b/src/appl/bsd/krsh.c index 4b4f9bc64..ae1a2d964 100644 --- a/src/appl/bsd/krsh.c +++ b/src/appl/bsd/krsh.c @@ -118,7 +118,7 @@ main(argc, argv0) if ( argc < 2 ) goto usage; argc--; argv++; - + another: if (argc > 0 && host == 0 && strncmp(*argv, "-", 1)) { host = *argv; @@ -391,7 +391,7 @@ main(argc, argv0) goto rewrite; wc = write(rem, bp, cc); if (wc < 0) { - if (errno == EWOULDBLOCK) + if ((errno == EWOULDBLOCK) || (errno == EAGAIN)) goto rewrite; goto done; } @@ -424,7 +424,7 @@ main(argc, argv0) errno = 0; cc = read(rfd2, buf, sizeof buf); if (cc <= 0) { - if (errno != EWOULDBLOCK) + if ((errno != EWOULDBLOCK) && (errno != EAGAIN)) readfrom &= ~(1<