[4/6] Convert fatal to error in remote_prepare

Message ID 1407340688-13721-5-git-send-email-gbenson@redhat.com
State Committed
Headers

Commit Message

Gary Benson Aug. 6, 2014, 3:58 p.m. UTC
  This commit converts a call to fatal in remote_prepare with a call to
error.  remote_prepare is called precisely once, from main, at a point
where jumping to toplevel will call exit (1), so error and fatal are
functionally equivalent at this point.  Note that remote_prepare calls
perror_with_name (which calls error) so callers of remote_prepare must
already handle the fact that it may exit via longjmp.

gdb/gdbserver/
2014-08-06  Gary Benson  <gbenson@redhat.com>

	* remote-utils.c (remote_prepare): Replace fatal with error.
---
 gdb/gdbserver/ChangeLog      |    4 ++++
 gdb/gdbserver/remote-utils.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)
  

Comments

Pedro Alves Aug. 20, 2014, 4:19 p.m. UTC | #1
On 08/06/2014 04:58 PM, Gary Benson wrote:
> This commit converts a call to fatal in remote_prepare with a call to
> error.  remote_prepare is called precisely once, from main, at a point
> where jumping to toplevel will call exit (1), so error and fatal are
> functionally equivalent at this point.  Note that remote_prepare calls
> perror_with_name (which calls error) so callers of remote_prepare must
> already handle the fact that it may exit via longjmp.
> 
> gdb/gdbserver/
> 2014-08-06  Gary Benson  <gbenson@redhat.com>
> 
> 	* remote-utils.c (remote_prepare): Replace fatal with error.

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 4fcafa0..027d2a7 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -253,7 +253,7 @@  remote_prepare (char *name)
 
   port = strtoul (port_str + 1, &port_end, 10);
   if (port_str[1] == '\0' || *port_end != '\0')
-    fatal ("Bad port argument: %s", name);
+    error ("Bad port argument: %s", name);
 
 #ifdef USE_WIN32API
   if (!winsock_initialized)