Index: stand/libsa/tftp.c =================================================================== --- stand/libsa/tftp.c +++ stand/libsa/tftp.c @@ -502,7 +502,7 @@ res = tftp_getnextblock(tftpfile); if (res) { /* no answer */ #ifdef TFTP_DEBUG - printf("tftp: read error\n"); + printf("tftp: read error res(%d)\n", res); #endif return (res); } @@ -617,11 +617,6 @@ ssize_t cc; time_t t, t1, tleft; -#ifdef TFTP_DEBUG - if (debug) - printf("sendrecv: called\n"); -#endif - tleft = MINTMO; t = t1 = getsecs(); for (;;) { @@ -644,6 +639,12 @@ recvnext: /* Try to get a packet and process it. */ cc = (*rproc)(h, pkt, payload, tleft, rtype); + if (errno == EAGAIN) { +#ifdef TFTP_DEBUG + printf("%s: EAGAIN, retrying\n", __func__); +#endif + goto recvnext; + } /* Return on data, EOF or real error. */ if (cc != -1 || errno != 0) return (cc);