From 63fb786c541926dbf03a9452288c6a938c7cd6c4 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Mon, 21 Feb 2011 12:39:48 -0600 Subject: [PATCH] rx: Reset fd_set in LWP rxi_Sendmsg When we select() on the socket fd in rxi_Sendmsg, we do not reset the fd_set, and just use the same memory for any necessary subsequent select()s. However, if the select returned on EINTR, the fd_set may be cleared, and so we may try to select() on an empty fd_set forever. To be sure that we don't do that, reset the fd_set to the socket fd every time. Change-Id: I5273351c70e593ad1b7849f4f56de1fcb12d1bbf Reviewed-on: http://gerrit.openafs.org/4028 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/rx/rx_lwp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/rx/rx_lwp.c b/src/rx/rx_lwp.c index acf267770..8ad021bf8 100644 --- a/src/rx/rx_lwp.c +++ b/src/rx/rx_lwp.c @@ -482,6 +482,8 @@ rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags) while ((err = select(socket + 1, 0, sfds, 0, 0)) != 1) { if (err >= 0 || errno != EINTR) osi_Panic("rxi_sendmsg: select error %d.%d", err, errno); + FD_ZERO(sfds); + FD_SET(socket, sfds); } } if (sfds) -- 2.39.5