aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHui Zhu <teawater@gmail.com>2011-12-18 15:49:04 +0000
committerHui Zhu <teawater@gmail.com>2011-12-18 15:49:04 +0000
commit66f1260e72ec8f436fd9948bb3df9050f1665ebf (patch)
treee22a80f75021b06a0b4a93a0fd2725468dece18a
parent64b986c0020e560e43cd438a82dc931cd61a363d (diff)
downloadgdb-66f1260e72ec8f436fd9948bb3df9050f1665ebf.zip
gdb-66f1260e72ec8f436fd9948bb3df9050f1665ebf.tar.gz
gdb-66f1260e72ec8f436fd9948bb3df9050f1665ebf.tar.bz2
2011-12-18 Hui Zhu <teawater@gmail.com>
* linux-low.c (linux_create_inferior): Save return value to ret.
-rw-r--r--gdb/gdbserver/ChangeLog4
-rw-r--r--gdb/gdbserver/linux-low.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 173cf0f..a7ad945 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2011-12-18 Hui Zhu <teawater@gmail.com>
+
+ * linux-low.c (linux_create_inferior): Save return value to ret.
+
2011-12-16 Doug Evans <dje@google.com>
* linux-low.c (linux_create_inferior): If stdio connection,
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index a712b1f..1b7d313 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -574,11 +574,12 @@ linux_create_inferior (char *program, char **allargs)
Also, redirect stdin to /dev/null. */
if (remote_connection_is_stdio ())
{
+ int ret;
close (0);
open ("/dev/null", O_RDONLY);
dup2 (2, 1);
- write (2, "stdin/stdout redirected\n",
- sizeof ("stdin/stdout redirected\n") - 1);
+ ret = write (2, "stdin/stdout redirected\n",
+ sizeof ("stdin/stdout redirected\n") - 1);
}
execv (program, allargs);