Skip to content

Commit

Permalink
Fix compile error when USE_POLL is not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
gwsw committed Mar 3, 2023
1 parent e1da993 commit 3b56da0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion os.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,19 @@ extern int tty;
extern char *ttyin_name;
#endif /*LESSTEST*/

#if USE_POLL
public void init_poll(void)
{
#if USE_POLL
#if defined(__APPLE__)
/* In old versions of MacOS, poll() does not work with /dev/tty. */
struct utsname uts;
if (uname(&uts) < 0 || lstrtoi(uts.release, NULL, 10) < 20)
use_poll = FALSE;
#endif
#endif
}

#if USE_POLL
/*
* Check whether data is available, either from a file/pipe or from the tty.
* Return READ_AGAIN if no data currently available, but caller should retry later.
Expand Down

0 comments on commit 3b56da0

Please sign in to comment.