From 66f1260e72ec8f436fd9948bb3df9050f1665ebf Mon Sep 17 00:00:00 2001 From: Hui Zhu Date: Sun, 18 Dec 2011 15:49:04 +0000 Subject: [PATCH] 2011-12-18 Hui Zhu * linux-low.c (linux_create_inferior): Save return value to ret. --- gdb/gdbserver/ChangeLog | 4 ++++ gdb/gdbserver/linux-low.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 173cf0f7527..a7ad94502b9 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,7 @@ +2011-12-18 Hui Zhu + + * linux-low.c (linux_create_inferior): Save return value to ret. + 2011-12-16 Doug Evans * linux-low.c (linux_create_inferior): If stdio connection, diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index a712b1f4bba..1b7d313c515 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); -- 2.30.2