From: Michael Meissner Date: Wed, 26 Nov 1997 21:52:16 +0000 (+0000) Subject: Flush writes to stdout, stderr X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ac0704137816bd777c0cd422a9a77a590e2c0732;p=binutils-gdb.git Flush writes to stdout, stderr --- diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 3180610a2b1..1afc9b9bf0d 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +Wed Nov 26 16:49:38 1997 Michael Meissner + + * syscall.c (cb_syscall): If writing to stdout or stderr, flush + the stream immediately. + Wed Nov 26 12:32:11 1997 Andrew Cagney * sim-io.c (sim_io_getstring): Delete unused len2. diff --git a/sim/common/syscall.c b/sim/common/syscall.c index a1031d936ed..b73cd99b393 100644 --- a/sim/common/syscall.c +++ b/sim/common/syscall.c @@ -318,9 +318,15 @@ cb_syscall (cb, sc) goto FinishSyscall; } if (fd == 1) - result = (int) (*cb->write_stdout) (cb, buf, bytes_read); + { + result = (int) (*cb->write_stdout) (cb, buf, bytes_read); + (*cb->flush_stdout) (cb); + } if (fd == 2) - result = (int) (*cb->write_stderr) (cb, buf, bytes_read); + { + result = (int) (*cb->write_stderr) (cb, buf, bytes_read); + (*cb->flush_stderr) (cb); + } else result = (int) (*cb->write) (cb, fd, buf, bytes_read); if (result == -1)