From 3e52c33d2398d3e707eb85762aa0929b11c59fb4 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sun, 18 Dec 2011 20:55:08 +0000 Subject: [PATCH] gdb/gdbserver/ * linux-low.c (linux_create_inferior): Put empty if clause for write. Revert: 2011-12-18 Hui Zhu * linux-low.c (linux_create_inferior): Save return value to ret. --- gdb/gdbserver/ChangeLog | 8 ++++++++ gdb/gdbserver/linux-low.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index a7ad94502b..7675733d0e 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,11 @@ +2011-12-18 Jan Kratochvil + + * linux-low.c (linux_create_inferior): Put empty if clause for write. + + Revert: + 2011-12-18 Hui Zhu + * linux-low.c (linux_create_inferior): Save return value to ret. + 2011-12-18 Hui Zhu * linux-low.c (linux_create_inferior): Save return value to ret. diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 1b7d313c51..c99e0a315f 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -574,12 +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); - ret = write (2, "stdin/stdout redirected\n", - sizeof ("stdin/stdout redirected\n") - 1); + if (write (2, "stdin/stdout redirected\n", + sizeof ("stdin/stdout redirected\n") - 1) < 0) + /* Errors ignored. */; } execv (program, allargs); -- 2.34.1