gdb/ARI: Call safe_strerror instead of strerror in linux-ptrace.c
authorJoel Brobecker <brobecker@adacore.com>
Tue, 20 Jan 2015 17:38:23 +0000 (18:38 +0100)
committerJoel Brobecker <brobecker@adacore.com>
Tue, 20 Jan 2015 18:08:17 +0000 (19:08 +0100)
gdb/ChangeLog:

        * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason_string)
        (linux_ptrace_test_ret_to_nx): Use safe_strerror instead of
        strerror.

gdb/ChangeLog
gdb/nat/linux-ptrace.c

index a704d5517d6f7edc1f6a0ecc369a35282d3f577e..8a7e1b08a395b67caf2800919ab38e52d07c9ba7 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-20  Joel Brobecker  <brobecker@adacore.com>
+
+       * nat/linux-ptrace.c (linux_ptrace_attach_fail_reason_string)
+       (linux_ptrace_test_ret_to_nx): Use safe_strerror instead of
+       strerror.
+
 2015-01-20  Wei-cheng Wang  <cole945@gmail.com>
 
        * rs6000-tdep.c (ppc_process_record_op4, ppc_process_record_op19,
index 39815928103d20c67e63e162aa1c9ab32a2e4e3b..0ce258f3692e657aa95954e43987ba0e355cad1d 100644 (file)
@@ -73,10 +73,10 @@ linux_ptrace_attach_fail_reason_string (ptid_t ptid, int err)
   warnings = buffer_finish (&buffer);
   if (warnings[0] != '\0')
     reason_string = xstrprintf ("%s (%d), %s",
-                               strerror (err), err, warnings);
+                               safe_strerror (err), err, warnings);
   else
     reason_string = xstrprintf ("%s (%d)",
-                               strerror (err), err);
+                               safe_strerror (err), err);
   xfree (warnings);
   return reason_string;
 }
@@ -111,7 +111,7 @@ linux_ptrace_test_ret_to_nx (void)
   if (return_address == MAP_FAILED)
     {
       warning (_("linux_ptrace_test_ret_to_nx: Cannot mmap: %s"),
-              strerror (errno));
+              safe_strerror (errno));
       return;
     }
 
@@ -123,7 +123,7 @@ linux_ptrace_test_ret_to_nx (void)
     {
     case -1:
       warning (_("linux_ptrace_test_ret_to_nx: Cannot fork: %s"),
-              strerror (errno));
+              safe_strerror (errno));
       return;
 
     case 0:
@@ -131,7 +131,7 @@ linux_ptrace_test_ret_to_nx (void)
                  (PTRACE_TYPE_ARG4) NULL);
       if (l != 0)
        warning (_("linux_ptrace_test_ret_to_nx: Cannot PTRACE_TRACEME: %s"),
-                strerror (errno));
+                safe_strerror (errno));
       else
        {
 #if defined __i386__
@@ -161,7 +161,7 @@ linux_ptrace_test_ret_to_nx (void)
   if (got_pid != child)
     {
       warning (_("linux_ptrace_test_ret_to_nx: waitpid returned %ld: %s"),
-              (long) got_pid, strerror (errno));
+              (long) got_pid, safe_strerror (errno));
       return;
     }
 
@@ -205,7 +205,7 @@ linux_ptrace_test_ret_to_nx (void)
   if (errno != 0)
     {
       warning (_("linux_ptrace_test_ret_to_nx: Cannot PTRACE_PEEKUSER: %s"),
-              strerror (errno));
+              safe_strerror (errno));
       return;
     }
   pc = (void *) (uintptr_t) l;
@@ -220,7 +220,7 @@ linux_ptrace_test_ret_to_nx (void)
     {
       warning (_("linux_ptrace_test_ret_to_nx: "
                 "PTRACE_KILL waitpid returned %ld: %s"),
-              (long) got_pid, strerror (errno));
+              (long) got_pid, safe_strerror (errno));
       return;
     }
   if (!WIFSIGNALED (kill_status))
This page took 0.036193 seconds and 4 git commands to generate.