Replace hardwired error handlers in tui_initialize_io
authorGary Benson <gbenson@redhat.com>
Mon, 4 Aug 2014 13:03:21 +0000 (14:03 +0100)
committerGary Benson <gbenson@redhat.com>
Fri, 29 Aug 2014 09:12:01 +0000 (10:12 +0100)
tui_initialize_io contains a pair of hardwired fprintf/exit error
handlers.  I was unable to find any documentation as to why they're
hardwired (the code appeared in a monolithic block back in 2001:
https://sourceware.org/ml/gdb-patches/2001-07/msg00490.html) and I
was also unable to come up with a situation where error would not
be suitable, so I have replaced both handlers with calls to error.

gdb/ChangeLog:

* tui/tui-io.c (tui_initialize_io): Replace two fprintf/exit
pairs with calls to error.  Wrap the message with _().

gdb/ChangeLog
gdb/tui/tui-io.c

index 9f02aad7dab0e6ed7d652c378c45cac1ec674cb0..809afe5e7335f65208f0ef80a186e98adca0a37b 100644 (file)
@@ -1,3 +1,8 @@
+2014-08-29  Gary Benson  <gbenson@redhat.com>
+
+       * tui/tui-io.c (tui_initialize_io): Replace two fprintf/exit
+       pairs with calls to error.  Wrap the message with _().
+
 2014-08-29  Gary Benson  <gbenson@redhat.com>
 
        * utils.c (vwarning): Protect calls to target_terminal_ours
index a890678d317e85f4d79942d1995897ccd08867d3..601d278c2df1371b8f564f699ce4c95e738ef448 100644 (file)
@@ -616,16 +616,12 @@ tui_initialize_io (void)
      readline output in a pipe, read that pipe and output the content
      in the curses command window.  */
   if (gdb_pipe_cloexec (tui_readline_pipe) != 0)
-    {
-      fprintf_unfiltered (gdb_stderr, "Cannot create pipe for readline");
-      exit (1);
-    }
+    error (_("Cannot create pipe for readline"));
+
   tui_rl_outstream = fdopen (tui_readline_pipe[1], "w");
   if (tui_rl_outstream == 0)
-    {
-      fprintf_unfiltered (gdb_stderr, "Cannot redirect readline output");
-      exit (1);
-    }
+    error (_("Cannot redirect readline output"));
+
   setvbuf (tui_rl_outstream, (char*) NULL, _IOLBF, 0);
 
 #ifdef O_NONBLOCK
This page took 0.045014 seconds and 4 git commands to generate.