Initialize terminal_state to terminal_is_ours
authorPatrick Palka <patrick@parcs.ath.cx>
Tue, 28 Jul 2015 17:58:17 +0000 (13:58 -0400)
committerPatrick Palka <patrick@parcs.ath.cx>
Wed, 29 Jul 2015 11:54:29 +0000 (07:54 -0400)
Right now this variable is initialized to 0 i.e. terminal_is_inferior
and does not get set to terminal_is_ours until target_terminal_init() is
called.  This function however only gets called when an inferior is
first created.  In the meantime, terminal_state would wrongly remain set
to terminal_is_inferior.

Tested on x86_64 Debian Stretch -- native, gdbserver and
extended-gdbserver.

gdb/ChangeLog:

* target.c (terminal_state): Initialize to terminal_is_ours.

gdb/ChangeLog
gdb/target.c

index 56ebcc6ee9a3e090901772ea87cda1d4c2e4362e..2e621847964f9858a6c7d534626a388b6a4818f7 100644 (file)
@@ -1,3 +1,7 @@
+2015-07-29  Patrick Palka  <patrick@parcs.ath.cx>
+
+       * target.c (terminal_state): Initialize to terminal_is_ours.
+
 2015-07-29  Yao Qi  <yao.qi@linaro.org>
 
        PR record/18691
index 01bac7e186112e9c41cd7f3b76781705c28e7126..c671e7c359283594b811a0b6cd37e1b9b67db27c 100644 (file)
@@ -444,7 +444,7 @@ enum terminal_state
     terminal_is_ours = 2
   };
 
-static enum terminal_state terminal_state;
+static enum terminal_state terminal_state = terminal_is_ours;
 
 /* See target.h.  */