+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,
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;
}
if (return_address == MAP_FAILED)
{
warning (_("linux_ptrace_test_ret_to_nx: Cannot mmap: %s"),
- strerror (errno));
+ safe_strerror (errno));
return;
}
{
case -1:
warning (_("linux_ptrace_test_ret_to_nx: Cannot fork: %s"),
- strerror (errno));
+ safe_strerror (errno));
return;
case 0:
(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__
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;
}
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;
{
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))