+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
}
if (ibits & (1<<f)) {
fcc = (*des_read)(f, fibuf, sizeof (fibuf));
- if (fcc < 0 && errno == EWOULDBLOCK)
+ if (fcc < 0 && ((errno == EWOULDBLOCK) || (errno == EAGAIN)))
fcc = 0;
else {
register unsigned char *cp;
if (ibits & (1<<p)) {
pcc = read(p, pibuf, sizeof (pibuf));
pbp = pibuf;
- if (pcc < 0 && errno == EWOULDBLOCK)
+ if (pcc < 0 && ((errno == EWOULDBLOCK) || (errno == EAGAIN)))
pcc = 0;
else if (pcc <= 0)
break;
}
if ((obits & (1<<f)) && pcc > 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;
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);
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){
if ( argc < 2 ) goto usage;
argc--;
argv++;
-
+
another:
if (argc > 0 && host == 0 && strncmp(*argv, "-", 1)) {
host = *argv;
goto rewrite;
wc = write(rem, bp, cc);
if (wc < 0) {
- if (errno == EWOULDBLOCK)
+ if ((errno == EWOULDBLOCK) || (errno == EAGAIN))
goto rewrite;
goto done;
}
errno = 0;
cc = read(rfd2, buf, sizeof buf);
if (cc <= 0) {
- if (errno != EWOULDBLOCK)
+ if ((errno != EWOULDBLOCK) && (errno != EAGAIN))
readfrom &= ~(1<<rfd2);
} else
(void) write(2, buf, cc);
errno = 0;
cc = read(rem, buf, sizeof buf);
if (cc <= 0) {
- if (errno != EWOULDBLOCK)
+ if ((errno != EWOULDBLOCK) && (errno != EAGAIN))
readfrom &= ~(1<<rem);
} else
(void) write(1, buf, cc);