Browse code

fix build when poll is not available.

git-svn: trunk@4966

Török Edvin authored on 2009/03/22 22:25:27
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sun Mar 22 15:25:13 EET 2009 (edwin)
2
+------------------------------------
3
+ * clamd/others.c: fix build when poll is not available.
4
+
1 5
 Fri Mar 20 20:10:26 EET 2009 (edwin)
2 6
 ------------------------------------
3 7
  * unit_tests/check_clamd.c: fix warning
... ...
@@ -568,7 +568,7 @@ int fds_poll_recv(struct fd_data *data, int timeout, int check_signals)
568 568
 	tv.tv_usec = 0;
569 569
 
570 570
 	pthread_mutex_unlock(&data->buf_mutex);
571
-	retval = select(maxfd+1, &rfds, NULL, NULL, timeout > 0 ? &tv : NULL);
571
+	retval = select(maxfd+1, &rfds, NULL, NULL, timeout >= 0 ? &tv : NULL);
572 572
 	pthread_mutex_lock(&data->buf_mutex);
573 573
 	if (retval > 0) {
574 574
 	    fdsok = data->nfds;
... ...
@@ -585,7 +585,7 @@ int fds_poll_recv(struct fd_data *data, int timeout, int check_signals)
585 585
 				 data->buf[i].fd);
586 586
 			else {
587 587
 			    /* avoid SHUT_WR problem on Mac OS X */
588
-			    int ret = send(data->poll_data[i].fd, &n, 0, 0);
588
+			    int ret = send(data->buf[i].fd, &i, 0, 0);
589 589
 			    if (!ret || (ret == -1 && errno == EINTR))
590 590
 				continue;
591 591
 			    logg("*Client disconnected\n");