aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/gdbreplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/gdbserver/gdbreplay.c')
-rw-r--r--gdb/gdbserver/gdbreplay.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c
index 4524274..ec7a2b8 100644
--- a/gdb/gdbserver/gdbreplay.c
+++ b/gdb/gdbserver/gdbreplay.c
@@ -54,14 +54,15 @@ static void
perror_with_name (char *string)
{
#ifndef STDC_HEADERS
- extern int sys_nerr;
- extern char *sys_errlist[];
extern int errno;
#endif
const char *err;
char *combined;
- err = (errno < sys_nerr) ? sys_errlist[errno] : "unknown error";
+ err = strerror (errno);
+ if (err == NULL)
+ err = "unknown error";
+
combined = (char *) alloca (strlen (err) + strlen (string) + 3);
strcpy (combined, string);
strcat (combined, ": ");