[5/6] Convert fatal to perror_with_name in IPA code

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

Commit Message

Gary Benson Aug. 6, 2014, 3:58 p.m. UTC
  This commit converts four calls to fatal into calls to
perror_with_name.  perror_with_name calls error, which
in IPA terminates with exit (1) rather than longjmp, so
there is no functional change here.

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

	* tracepoint.c (gdb_agent_init): Replace fatal with
	perror_with_name.
	(initialize_tracepoint): Likewise.
---
 gdb/gdbserver/ChangeLog    |    6 ++++++
 gdb/gdbserver/tracepoint.c |   10 ++++------
 2 files changed, 10 insertions(+), 6 deletions(-)
  

Comments

Pedro Alves Aug. 20, 2014, 4:24 p.m. UTC | #1
On 08/06/2014 04:58 PM, Gary Benson wrote:
> This commit converts four calls to fatal into calls to
> perror_with_name.  perror_with_name calls error, which
> in IPA terminates with exit (1) rather than longjmp, so
> there is no functional change here.
> 
> gdb/gdbserver/
> 2014-08-06  Gary Benson  <gbenson@redhat.com>
> 
> 	* tracepoint.c (gdb_agent_init): Replace fatal with
> 	perror_with_name.
> 	(initialize_tracepoint): Likewise.

OK.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c
index 92c26aa..617d903 100644
--- a/gdb/gdbserver/tracepoint.c
+++ b/gdb/gdbserver/tracepoint.c
@@ -7292,7 +7292,7 @@  gdb_agent_init (void)
   sigfillset (&new_mask);
   res = pthread_sigmask (SIG_SETMASK, &new_mask, &orig_mask);
   if (res)
-    fatal ("pthread_sigmask (1) failed: %s", strerror (res));
+    perror_with_name ("pthread_sigmask (1)");
 
   res = pthread_create (&thread,
 			NULL,
@@ -7301,7 +7301,7 @@  gdb_agent_init (void)
 
   res = pthread_sigmask (SIG_SETMASK, &orig_mask, NULL);
   if (res)
-    fatal ("pthread_sigmask (2) failed: %s", strerror (res));
+    perror_with_name ("pthread_sigmask (2)");
 
   while (helper_thread_id == 0)
     usleep (1);
@@ -7382,7 +7382,7 @@  initialize_tracepoint (void)
 
     pagesize = sysconf (_SC_PAGE_SIZE);
     if (pagesize == -1)
-      fatal ("sysconf");
+      perror_with_name ("sysconf");
 
     gdb_tp_heap_buffer = xmalloc (5 * 1024 * 1024);
 
@@ -7401,9 +7401,7 @@  initialize_tracepoint (void)
       }
 
     if (addr == 0)
-      fatal ("\
-initialize_tracepoint: mmap'ing jump pad buffer failed with %s",
-	     strerror (errno));
+      perror_with_name ("mmap");
 
     gdb_jump_pad_buffer_end = gdb_jump_pad_buffer + pagesize * SCRATCH_BUFFER_NPAGES;
   }