[PATCH v1 2/2] _rpc_dtablesize: Cleaning up the existing code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some users have already taken steps to address this issue. To prevent
duplication, we need to remove the modified code and modify the rpc_dtablesize
function.

Signed-off-by: Zhuohao Bai <zhuohao_bai@xxxxxxxxxxx>
---
 src/rpc_dtablesize.c | 4 +++-
 src/svc.c            | 2 --
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/rpc_dtablesize.c b/src/rpc_dtablesize.c
index 12f80c1..e88698f 100644
--- a/src/rpc_dtablesize.c
+++ b/src/rpc_dtablesize.c
@@ -41,7 +41,9 @@ _rpc_dtablesize(void)
 	static int size;
 
 	if (size == 0) {
-		size = min(1024, sysconf(_SC_OPEN_MAX));
+		size = sysconf(_SC_OPEN_MAX);
+		if (size > FD_SETSIZE)
+			size = FD_SETSIZE;
 	}
 	return (size);
 }
diff --git a/src/svc.c b/src/svc.c
index 3a8709f..9b932a5 100644
--- a/src/svc.c
+++ b/src/svc.c
@@ -657,8 +657,6 @@ svc_getreqset (readfds)
   assert (readfds != NULL);
 
   setsize = _rpc_dtablesize ();
-  if (setsize > FD_SETSIZE)
-    setsize = FD_SETSIZE;
   maskp = readfds->fds_bits;
   for (sock = 0; sock < setsize; sock += NFDBITS)
     {
-- 
2.25.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux