mirror of
https://github.com/simh/simh.git
synced 2026-05-02 22:22:48 +00:00
SCP: Support host environments which can't do termios TCSAFLUSH
This commit is contained in:
@@ -3928,6 +3928,12 @@ return SCPE_OK;
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
#if !defined(CANT_USE_TERMIOS_TCSAFLUSH)
|
||||||
|
#define TCSETATTR_ACTION TCSAFLUSH
|
||||||
|
#else
|
||||||
|
#define TCSETATTR_ACTION TCSANOW
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
@@ -3988,7 +3994,7 @@ runtty.c_cc[VINTR] = 0; /* OS X doesn't deliver
|
|||||||
#else
|
#else
|
||||||
runtty.c_cc[VINTR] = sim_int_char; /* in case changed */
|
runtty.c_cc[VINTR] = sim_int_char; /* in case changed */
|
||||||
#endif
|
#endif
|
||||||
if (tcsetattr (fileno(stdin), TCSAFLUSH, &runtty) < 0)
|
if (tcsetattr (fileno(stdin), TCSETATTR_ACTION, &runtty) < 0)
|
||||||
return SCPE_TTIERR;
|
return SCPE_TTIERR;
|
||||||
sim_os_set_thread_priority (PRIORITY_BELOW_NORMAL); /* try to lower pri */
|
sim_os_set_thread_priority (PRIORITY_BELOW_NORMAL); /* try to lower pri */
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
@@ -3999,7 +4005,7 @@ static t_stat sim_os_ttcmd (void)
|
|||||||
if (!isatty (fileno (stdin))) /* skip if !tty */
|
if (!isatty (fileno (stdin))) /* skip if !tty */
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
sim_os_set_thread_priority (PRIORITY_NORMAL); /* try to raise pri */
|
sim_os_set_thread_priority (PRIORITY_NORMAL); /* try to raise pri */
|
||||||
if (tcsetattr (fileno(stdin), TCSAFLUSH, &cmdtty) < 0)
|
if (tcsetattr (fileno(stdin), TCSETATTR_ACTION, &cmdtty) < 0)
|
||||||
return SCPE_TTIERR;
|
return SCPE_TTIERR;
|
||||||
return SCPE_OK;
|
return SCPE_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user