From ba37055c969d1d8c786c42657d1a8a998ad7eac2 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Mon, 26 Feb 2018 18:24:24 +0000 Subject: [PATCH] libsa: Partially revert r330023 The removal of tmo >= MAXTMO check should not have been done; this is specifically what handles timeout if MAXWAIT == 0. MFC after: 1 week --- stand/libsa/net.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/stand/libsa/net.c b/stand/libsa/net.c index e0f8e8a208e..31ff5e3ce36 100644 --- a/stand/libsa/net.c +++ b/stand/libsa/net.c @@ -110,6 +110,10 @@ sendrecv(struct iodesc *d, return -1; } if (tleft <= 0) { + if (tmo >= MAXTMO) { + errno = ETIMEDOUT; + return -1; + } cc = (*sproc)(d, sbuf, ssize); if (cc != -1 && cc < ssize) panic("sendrecv: short write! (%zd < %zd)",