All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] recvmsg01: fix select() nfds for UNIX socket
@ 2015-01-10 10:20 Jan Stancek
  2015-01-13  9:28 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Stancek @ 2015-01-10 10:20 UTC (permalink / raw)
  To: ltp-list

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

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 testcases/kernel/syscalls/recvmsg/recvmsg01.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/testcases/kernel/syscalls/recvmsg/recvmsg01.c b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
index 1216935..28626e3 100644
--- a/testcases/kernel/syscalls/recvmsg/recvmsg01.c
+++ b/testcases/kernel/syscalls/recvmsg/recvmsg01.c
@@ -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)) {
-- 
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [LTP] [PATCH] recvmsg01: fix select() nfds for UNIX socket
  2015-01-10 10:20 [LTP] [PATCH] recvmsg01: fix select() nfds for UNIX socket Jan Stancek
@ 2015-01-13  9:28 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2015-01-13  9:28 UTC (permalink / raw)
  To: Jan Stancek; +Cc: ltp-list

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

Good catch, acked.

Please push this ASAP.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-01-13  9:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-10 10:20 [LTP] [PATCH] recvmsg01: fix select() nfds for UNIX socket Jan Stancek
2015-01-13  9:28 ` Cyril Hrubis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.