Skip to contentSkip to conversation

recvmsg01: fix select() nfds for UNIX socket

PATCH In review Jan Stancek 2 participants 2 messages Jan 10, 2015 – Jan 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 recvmsg01: fix select() nfds for UNIX socket

commit 7855d094bbeb9b8ce43dd698ec82e400eb91e709 did this for accept() on INET socket, but missed UNIX one.

---
 testcases/kernel/syscalls/recvmsg/recvmsg01.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
testcases/kernel/syscalls/recvmsg/recvmsg01.c +3 -1
index 1216935..28626e3 100644
@@ -480,8 +480,10 @@ void do_child(void)
 
 			fromlen = sizeof(fsun);
 			newfd = accept(ufd, (struct sockaddr *)&fsun, &fromlen);
-			if (newfd >= 0)
+			if (newfd >= 0) {
 				FD_SET(newfd, &afds);
+				nfds = MAX(nfds, newfd + 1);
+			}
 		}
 		for (fd = 0; fd < nfds; ++fd)
 			if (fd != sfd && fd != ufd && FD_ISSET(fd, &rfds)) {
Signature · 13 lines
1.7.1


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 2 lines

commit 7855d094bbeb9b8ce43dd698ec82e400eb91e709 did this for accept() on INET socket, but missed UNIX one.

Good catch, acked.

Please push this ASAP.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list