Skip to content

Commit 09a5bca

Browse files
committed
[notcurses] use timeout with ppoll when there is still data in the buffer
1 parent 00afc5f commit 09a5bca

File tree

1 file changed

+1
-1
lines changed
  • src/third-party/notcurses/src/lib

1 file changed

+1
-1
lines changed

src/third-party/notcurses/src/lib/in.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2662,7 +2662,7 @@ block_on_input(inputctx* ictx, unsigned* rtfd, unsigned* rifd){
26622662
while((events = poll(pfds, pfdcount, timeoutms)) < 0){ // FIXME smask?
26632663
#else
26642664
struct timespec ts = { .tv_sec = ictx->ibufvalid == 0 ? 1 : 0, .tv_nsec = ictx->ibufvalid == 0 ? 0 : 10000000, };
2665-
struct timespec* pts = nonblock ? &ts : NULL;
2665+
struct timespec* pts = nonblock || ictx->ibufvalid > 0 ? &ts : NULL;
26662666
while((events = ppoll(pfds, pfdcount, pts, &smask)) < 0){
26672667
#endif
26682668
if(errno == EINTR){

0 commit comments

Comments
 (0)