Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 130701790bf2d95e902edf16031ff596 > files > 95

autofs-5.0.1-0.rc2.164.el5_8.src.rpm

autofs-5.0.1 - fix timeout in connect_nb()

From: Ian Kent <raven@themaw.net>

When changing the timed wait from using select(2) to poll(2) in
connect_nb(), to overcome the 1024 file handle limit of select(),
the wait timeout was not converted from seconds to milliseconds.
---

 lib/rpc_subs.c |    7 +++++++
 1 file changed, 7 insertions(+)


--- autofs-5.0.1.orig/lib/rpc_subs.c
+++ autofs-5.0.1/lib/rpc_subs.c
@@ -234,6 +234,13 @@ static int connect_nb(int fd, struct soc
 	if (ret == 0)
 		goto done;
 
+	if (timeout != -1) {
+		if (timeout >= (INT_MAX - 1)/1000)
+			timeout = INT_MAX - 1;
+		else
+			timeout = timeout * 1000;
+	}
+
 	pfd[0].fd = fd;
 	pfd[0].events = POLLOUT;