View | Details | Raw Unified | Return to bug 1517
Collapse All | Expand All

(-)clientloop.c (-1 / +1 lines)
Lines 566-572 client_wait_until_can_do_something(fd_se Link Here
566
		tv.tv_usec = 0;
566
		tv.tv_usec = 0;
567
		tvp = &tv;
567
		tvp = &tv;
568
	}
568
	}
569
	ret = select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp);
569
	ret = debug_select((*maxfdp)+1, *readsetp, *writesetp, NULL, tvp);
570
	if (ret < 0) {
570
	if (ret < 0) {
571
		char buf[100];
571
		char buf[100];
572
572
(-)misc.c (+50 lines)
Lines 832-834 ms_to_timeval(struct timeval *tv, int ms Link Here
832
	tv->tv_usec = (ms % 1000) * 1000;
832
	tv->tv_usec = (ms % 1000) * 1000;
833
}
833
}
834
834
835
int
836
debug_select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
837
    struct timeval *timeout)
838
{
839
	int i, ret;
840
841
	debug3("%s: nfds = %d", __func__, nfds);
842
	debug3("%s: readfds = %p, writefds = %p, exceptfds = %p", __func__,
843
	    readfds, writefds, exceptfds);
844
	if (timeout == NULL)
845
		debug3("%s: timeout = NULL", __func__);
846
	else
847
		debug3("%s: timeout = %p { %ld, %ld }", __func__, timeout,
848
		    timeout->tv_sec, timeout->tv_usec);
849
	for (i = 0; readfds && i < nfds; i++) {
850
		if (FD_ISSET(i, readfds))
851
			debug3("%s: before rfd %d%s", __func__, i,
852
			    fcntl(i, F_GETFL, 0) < 0 ? " INVALID" : "");
853
	}
854
	for (i = 0; writefds && i < nfds; i++) {
855
		if (FD_ISSET(i, writefds))
856
			debug3("%s: before wfd %d%s", __func__, i,
857
			    fcntl(i, F_GETFL, 0) < 0 ? " INVALID" : "");
858
	}
859
	for (i = 0; exceptfds && i < nfds; i++) {
860
		if (FD_ISSET(i, exceptfds))
861
			debug3("%s: before efd %d%s", __func__, i,
862
			    fcntl(i, F_GETFL, 0) < 0 ? " INVALID" : "");
863
	}
864
	errno = 0;
865
	ret = select(nfds, readfds, writefds, exceptfds, timeout);
866
	debug3("%s: select() = %d", __func__, ret);
867
	if (ret < 0)
868
		debug3("%s: errno = %d: %s", __func__, errno, strerror(errno));
869
870
	for (i = 0; readfds && ret > 0 && i < nfds; i++) {
871
		if (FD_ISSET(i, readfds))
872
			debug3("%s: after rfd %d", __func__, i);
873
	}
874
	for (i = 0; writefds && ret > 0 && i < nfds; i++) {
875
		if (FD_ISSET(i, writefds))
876
			debug3("%s: after wfd %d", __func__, i);
877
	}
878
	for (i = 0; exceptfds && ret > 0 && i < nfds; i++) {
879
		if (FD_ISSET(i, exceptfds))
880
			debug3("%s: after efd %d", __func__, i);
881
	}
882
	return ret;
883
}
884
(-)misc.h (+1 lines)
Lines 35-40 char *tohex(const void *, size_t); Link Here
35
void	 sanitise_stdfd(void);
35
void	 sanitise_stdfd(void);
36
void	 ms_subtract_diff(struct timeval *, int *);
36
void	 ms_subtract_diff(struct timeval *, int *);
37
void	 ms_to_timeval(struct timeval *, int);
37
void	 ms_to_timeval(struct timeval *, int);
38
int	 debug_select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
38
39
39
struct passwd *pwcopy(struct passwd *);
40
struct passwd *pwcopy(struct passwd *);
40
const char *ssh_gai_strerror(int);
41
const char *ssh_gai_strerror(int);

Return to bug 1517