comparison dbutil.c @ 1835:90ac15aeac43

Bring back recently removed channel->flushing This resolves the "sleep 10&echo hello" case which should return immediately
author Matt Johnston <matt@codeconstruct.com.au>
date Thu, 14 Oct 2021 20:55:15 +0800
parents 870f6e386a0b
children 7f549ee3df48
comparison
equal deleted inserted replaced
1834:94dc11094e26 1835:90ac15aeac43
713 } 713 }
714 714
715 m_free(fn_dir); 715 m_free(fn_dir);
716 #endif 716 #endif
717 } 717 }
718
719 int fd_read_pending(int fd) {
720 fd_set fds;
721 struct timeval timeout;
722
723 DROPBEAR_FD_ZERO(&fds);
724 FD_SET(fd, &fds);
725 while (1) {
726 timeout.tv_sec = 0;
727 timeout.tv_usec = 0;
728 if (select(fd+1, &fds, NULL, NULL, &timeout) < 0) {
729 if (errno == EINTR) {
730 continue;
731 }
732 return 0;
733 }
734 return FD_ISSET(fd, &fds);
735 }
736 }