fix some stderr buffering problems related to Windows pipes
svn: r10460
This commit is contained in:
parent
034d55ac4f
commit
f7939ab35d
|
@ -2546,6 +2546,7 @@ static void MrEdSchemeMessages(char *msg, ...)
|
|||
#if WINDOW_STDIO
|
||||
if (wx_in_terminal) {
|
||||
vfprintf(stderr, msg, args);
|
||||
fflush(stderr);
|
||||
} else if (!msg) {
|
||||
char *s;
|
||||
wxchar *us;
|
||||
|
@ -2615,6 +2616,7 @@ static void MrEdSchemeMessages(char *msg, ...)
|
|||
#endif
|
||||
#if !WINDOW_STDIO && !WCONSOLE_STDIO
|
||||
vfprintf(mrerr, msg, args);
|
||||
fflush(mrerr);
|
||||
#endif
|
||||
|
||||
scheme_end_atomic_no_swap();
|
||||
|
|
|
@ -343,6 +343,8 @@ static Scheme_Object *make_oskit_console_input_port();
|
|||
static void force_close_output_port(Scheme_Object *port);
|
||||
static void force_close_input_port(Scheme_Object *port);
|
||||
|
||||
static void set_fd_flush_mode(Scheme_Object *o, int mode);
|
||||
|
||||
static Scheme_Object *text_symbol, *binary_symbol;
|
||||
static Scheme_Object *append_symbol, *error_symbol, *update_symbol, *can_update_symbol;
|
||||
static Scheme_Object *replace_symbol, *truncate_symbol, *truncate_replace_symbol;
|
||||
|
@ -534,6 +536,12 @@ scheme_init_port (Scheme_Env *env)
|
|||
#endif
|
||||
);
|
||||
|
||||
#ifdef MZ_FDS
|
||||
# ifdef WINDOWS_FILE_HANDLES
|
||||
set_fd_flush_mode(scheme_orig_stderr_port, MZ_FLUSH_ALWAYS);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
flush_out = SCHEME_TRUEP(scheme_terminal_port_p(1, &scheme_orig_stdout_port));
|
||||
flush_err = SCHEME_TRUEP(scheme_terminal_port_p(1, &scheme_orig_stderr_port));
|
||||
|
||||
|
@ -6324,6 +6332,11 @@ make_fd_output_port(int fd, Scheme_Object *name, int regfile, int win_textmode,
|
|||
return the_port;
|
||||
}
|
||||
|
||||
static void set_fd_flush_mode(Scheme_Object *o, int mode)
|
||||
{
|
||||
((Scheme_FD *)((Scheme_Output_Port *)o)->port_data)->flush = mode;
|
||||
}
|
||||
|
||||
static void flush_if_output_fds(Scheme_Object *o, Scheme_Close_Custodian_Client *f, void *data)
|
||||
{
|
||||
if (SCHEME_OUTPUT_PORTP(o)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user