gas/
[deliverable/binutils-gdb.git] / gdb / inflow.c
index 6ca5bd8cc4a05d179fef87f3eb9ecb75cc739501..9ec45dd09015e11b811190921a2cf2781071f446 100644 (file)
@@ -51,8 +51,6 @@ extern void _initialize_inflow (void);
 
 static void pass_signal (int);
 
-static void kill_command (char *, int);
-
 static void terminal_ours_1 (int);
 \f
 /* Record terminal status separately for debugger and inferior.  */
@@ -361,6 +359,8 @@ terminal_ours_1 (int output_only)
   if (terminal_is_ours)
     return;
 
+  terminal_is_ours = 1;
+
   /* Checking inferior->run_terminal is necessary so that
      if GDB is running in the background, it won't block trying
      to do the ioctl()'s below.  Checking gdb_has_a_terminal
@@ -371,7 +371,6 @@ terminal_ours_1 (int output_only)
   if (inf->terminal_info->run_terminal != NULL || gdb_has_a_terminal () == 0)
     return;
 
-  if (!terminal_is_ours)
     {
 #ifdef SIGTTOU
       /* Ignore this signal since it will happen when we try to set the
@@ -380,8 +379,6 @@ terminal_ours_1 (int output_only)
 #endif
       int result;
 
-      terminal_is_ours = 1;
-
 #ifdef SIGTTOU
       if (job_control)
        osigttou = (void (*)()) signal (SIGTTOU, SIG_IGN);
@@ -495,7 +492,8 @@ copy_terminal_info (struct inferior *to, struct inferior *from)
 {
   *to->terminal_info = *from->terminal_info;
   if (from->terminal_info->run_terminal)
-    to->terminal_info->run_terminal = from->terminal_info->run_terminal;
+    to->terminal_info->run_terminal
+      = xstrdup (from->terminal_info->run_terminal);
 }
 
 void
This page took 0.024151 seconds and 4 git commands to generate.