Skip to contentSkip to conversation

CLD: forgot FD_ZERO in test/large-object.c

PATCH Applied Pete Zaitcev 2 participants 2 messages Dec 3, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CLD: forgot FD_ZERO in test/large-object.c

---
 test/large-object.c |    1 +
 1 file changed, 1 insertion(+)
test/large-object.c +1 -0
index f0884b8..fbed9b7 100644
@@ -28,6 +28,7 @@ static bool send_buf(struct st_client *stc, int sfd, void *buf, size_t buf_len)
 	while (buf_len) {
 		FD_ZERO(&wset);
 		FD_SET(sfd, &wset);
+		FD_ZERO(&rset);
 		FD_SET(sfd, &rset);
 		rc = select(sfd + 1, &rset, &wset, NULL, NULL);
 		OK(rc >= 0);
Applied
#1 lore raw
Quoted 10 lines · Pete Zaitcev
---
  test/large-object.c |    1 +
  1 file changed, 1 insertion(+)
test/large-object.c +0 -0
index f0884b8..fbed9b7 100644

test/large-object.c static bool send_buf(struct st_client *stc, int sfd, void *buf, size_t buf_len) · line 34

Quoted 7 lines
test/large-object.c +1 -0
@@ -28,6 +28,7 @@ static bool send_buf(struct st_client *stc, int sfd, void *buf, size_t buf_len)
  	while (buf_len) {
  		FD_ZERO(&wset);
  		FD_SET(sfd,&wset);
+		FD_ZERO(&rset);
  		FD_SET(sfd,&rset);
  		rc = select(sfd + 1,&rset,&wset, NULL, NULL);
  		OK(rc>= 0);

applied to chunkd ($subject indicated cld)

This is one of the many reasons why I prefer poll(2). One record per poll entry, which is quite convenient for small numbers of fd's.

Jeff