Skip to content

Commit

Permalink
poll: handle NULL as -1 on apple #195
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Jul 13, 2021
1 parent 622ae01 commit a8baa6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ block_on_input(int fd, const struct timespec* ts, const sigset_t* sigmask){
#endif
int events;
#ifdef __APPLE__
int timeoutms = ts->tv_sec * 1000 + ts->tv_nsec / 1000000;
int timeoutms = ts ? ts->tv_sec * 1000 + ts->tv_nsec / 1000000 : -1;
while((events = poll(&pfd, 1, timeoutms)) < 0){ // FIXME scratchmask?
#else
while((events = ppoll(&pfd, 1, ts, &scratchmask)) < 0){
Expand Down

0 comments on commit a8baa6c

Please sign in to comment.