aboutsummaryrefslogtreecommitdiff
path: root/sim/common/syscall.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2007-10-11 18:44:07 +0000
committerDaniel Jacobowitz <drow@false.org>2007-10-11 18:44:07 +0000
commiteb639c500494ee8c4ca8978c50451dca10112744 (patch)
treeaea47081d1300f0357ab386bc139b3c53f2e31c5 /sim/common/syscall.c
parentb981d7096356e3e92b66f0813881754fc69bf41d (diff)
downloadgdb-eb639c500494ee8c4ca8978c50451dca10112744.zip
gdb-eb639c500494ee8c4ca8978c50451dca10112744.tar.gz
gdb-eb639c500494ee8c4ca8978c50451dca10112744.tar.bz2
2007-10-11 Jesper Nilsson <jesper.nilsson@axis.com>
* callback.c (cb_is_stdin, cb_is_stdout, cb_is_stderr): Add functions. * syscall.c (cb_syscall): Test for stdin/out/err, not just fd 0/1/2. 2007-10-11 Jesper Nilsson <jesper.nilsson@axis.com> * callback.h (cb_is_stdin, cb_is_stdout, cb_is_stderr): Add prototypes. 2007-10-11 Jesper Nilsson <jesper.nilsson@axis.com> * sim/cris/c/freopen2.c: Added testcase.
Diffstat (limited to 'sim/common/syscall.c')
-rw-r--r--sim/common/syscall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sim/common/syscall.c b/sim/common/syscall.c
index a3e7560..b002448 100644
--- a/sim/common/syscall.c
+++ b/sim/common/syscall.c
@@ -344,12 +344,12 @@ cb_syscall (cb, sc)
errcode = EINVAL;
goto FinishSyscall;
}
- if (fd == 1)
+ if (cb_is_stdout(cb, fd))
{
result = (int) (*cb->write_stdout) (cb, buf, bytes_read);
(*cb->flush_stdout) (cb);
}
- else if (fd == 2)
+ else if (cb_is_stderr(cb, fd))
{
result = (int) (*cb->write_stderr) (cb, buf, bytes_read);
(*cb->flush_stderr) (cb);