Skip to contentSkip to conversation

Redundant code?

PATCH Stuart MacDonald 2 participants 3 messages Jun 2, 2003 VFS

lore
Share & tools
lore
#0 lore raw

Seems to me the following is redundant code, since get_fd_set also memsets the fds.res_* bitmaps.

..Stu

fs/select.c +0 -3
@@ -344,9 +344,6 @@
 	    (ret = get_fd_set(n, outp, fds.out)) ||
 	    (ret = get_fd_set(n, exp, fds.ex)))
 		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
 
 	ret = do_select(n, &fds, &timeout);
 
#1 lore raw
Quoted 9 lines · Stuart MacDonald

Seems to me the following is redundant code, since get_fd_set also memsets the fds.res_* bitmaps.

..Stu

fs/select.c line 349

Quoted 9 lines
fs/select.c +0 -3
@@ -344,9 +344,6 @@
 	    (ret = get_fd_set(n, outp, fds.out)) ||
 	    (ret = get_fd_set(n, exp, fds.ex)))
 		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
 
 	ret = do_select(n, &fds, &timeout);
 

fds.in != fds.res_in

--
Brian Gerst

#2 lore raw

From: [email protected]

Quoted 13 lines
Quoted 1 line · Stuart MacDonald

--- linux-2.5.70/fs/select.c 2003-05-26

21:00:21.000000000 -0400

Quoted 1 line

+++ linux-2.5.70-new/fs/select.c 2003-06-02

11:40:24.000000000 -0400

Quoted 8 lines
fs/select.c +0 -3
@@ -344,9 +344,6 @@
 	    (ret = get_fd_set(n, outp, fds.out)) ||
 	    (ret = get_fd_set(n, exp, fds.ex)))
 		goto out;
-	zero_fd_set(n, fds.res_in);
-	zero_fd_set(n, fds.res_out);
-	zero_fd_set(n, fds.res_ex);
 
Quoted 3 lines

fs/select.c line 348

Quoted 1 line
fs/select.c +0 -0
 	ret = do_select(n, &fds, &timeout);

fds.in != fds.res_in

<smacks forehead> You are correct.

..Stu