summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-08-28 17:40:58 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-08-28 17:40:58 +0000
commit602e3198bc03297b7d9cb34ed3838272254eba1f (patch)
tree01af773a194c74db87c4f7c19380b8e5bd53097f /gdb/gdbserver/server.c
parent7893c1628865061e2a2fb1ba84103ca18a44f0fa (diff)
downloadbinutils-gdb-602e3198bc03297b7d9cb34ed3838272254eba1f.tar.gz
PR server/15604
gdb/gdbserver/ 2013-08-28 Jan Kratochvil <jan.kratochvil@redhat.com> PR server/15604 * linux-low.c: Include filestuff.h. (linux_create_inferior) <pid == 0>: Call close_most_fds. * lynx-low.c: Include filestuff.h. (lynx_create_inferior) <pid == 0>: Call close_most_fds. * server.c: Include filestuff.h. (main): Call notice_open_fds. * spu-low.c: Include filestuff.h. (spu_create_inferior) <pid == 0>: Call close_most_fds.
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index a4b9129bbfd..ebdaba50467 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -28,6 +28,7 @@
#endif
#include "gdb_wait.h"
#include "btrace-common.h"
+#include "filestuff.h"
/* The thread set with an `Hc' packet. `Hc' is deprecated in favor of
`vCont'. Note the multi-process extensions made `vCont' a
@@ -2850,6 +2851,10 @@ main (int argc, char *argv[])
exit (1);
}
+ /* Remember stdio descriptors. LISTEN_DESC must not be listed, it will be
+ opened by remote_prepare. */
+ notice_open_fds ();
+
/* We need to know whether the remote connection is stdio before
starting the inferior. Inferiors created in this scenario have
stdin,stdout redirected. So do this here before we call