Skip to content

Commit

Permalink
Move any_data under #if USE_POLL and ensure that tty variable
Browse files Browse the repository at this point in the history
is not accessed when it does not exist (in MSDOS build).
  • Loading branch information
gwsw committed May 29, 2023
1 parent 883fc6c commit bd05d51
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 @@ -48,6 +48,7 @@ static int use_poll = TRUE;
#endif
#if USE_POLL
#include <poll.h>
static int any_data = FALSE;
#endif

/*
Expand All @@ -72,7 +73,6 @@ public int consecutive_nulls = 0;
/* Milliseconds to wait for data before displaying "waiting for data" message. */
static int waiting_for_data_delay = 4000;
static jmp_buf read_label;
static int any_data = FALSE;

extern int sigs;
extern int ignore_eoi;
Expand Down Expand Up @@ -292,8 +292,10 @@ public int iread(int fd, unsigned char *buf, unsigned int len)
#endif
return (READ_ERR);
}
#if USE_POLL
if (fd != tty && n > 0)
any_data = TRUE;
#endif
return (n);
}

Expand Down

0 comments on commit bd05d51

Please sign in to comment.