diff options
author | Eric Andersen <andersen@codepoet.org> | 2003-08-20 14:57:21 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2003-08-20 14:57:21 +0000 |
commit | 772128bd40162c51a7a7f6fe7074660fdc83a48d (patch) | |
tree | 4014867c0a6458288d54a49fd104eb8b64bebf46 | |
parent | 7c6a2b226cf8475e4dfcc16fd14e461c83055728 (diff) | |
download | buildroot-novena-772128bd40162c51a7a7f6fe7074660fdc83a48d.tar.gz buildroot-novena-772128bd40162c51a7a7f6fe7074660fdc83a48d.zip |
fix all uses of sys_nerr and sys_errlist[]
-rw-r--r-- | sources/gdb.patch | 125 |
1 files changed, 122 insertions, 3 deletions
diff --git a/sources/gdb.patch b/sources/gdb.patch index e7868a172..e44b15ccd 100644 --- a/sources/gdb.patch +++ b/sources/gdb.patch @@ -498,9 +498,114 @@ Fix build on Sparc. #include <asm/reg.h> #else #include <machine/reg.h> ---- gdb-5.3/gdb/gdbserver/utils.c.orig 2003-08-20 08:34:18.000000000 -0600 -+++ gdb-5.3/gdb/gdbserver/utils.c 2003-08-20 08:35:00.000000000 -0600 -@@ -40,9 +40,8 @@ +diff -urN gdb-5.3/gdb/gdbserver.orig/gdbreplay.c gdb-5.3/gdb/gdbserver/gdbreplay.c +--- gdb-5.3/gdb/gdbserver.orig/gdbreplay.c 2002-07-09 11:38:58.000000000 -0600 ++++ gdb-5.3/gdb/gdbserver/gdbreplay.c 2003-08-20 08:44:20.000000000 -0600 +@@ -54,14 +54,15 @@ + 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, ": "); +diff -urN gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c gdb-5.3/gdb/gdbserver/low-hppabsd.c +--- gdb-5.3/gdb/gdbserver.orig/low-hppabsd.c 2002-01-17 14:13:49.000000000 -0700 ++++ gdb-5.3/gdb/gdbserver/low-hppabsd.c 2003-08-20 08:46:04.000000000 -0600 +@@ -61,7 +61,7 @@ + execv (program, allargs); + + fprintf (stderr, "Cannot exec %s: %s.\n", program, +- errno < sys_nerr ? sys_errlist[errno] : "unknown error"); ++ strerror (errno)); + fflush (stderr); + _exit (0177); + } +diff -urN gdb-5.3/gdb/gdbserver.orig/low-lynx.c gdb-5.3/gdb/gdbserver/low-lynx.c +--- gdb-5.3/gdb/gdbserver.orig/low-lynx.c 2002-01-17 14:13:49.000000000 -0700 ++++ gdb-5.3/gdb/gdbserver/low-lynx.c 2003-08-20 08:46:18.000000000 -0600 +@@ -79,7 +79,7 @@ + + fprintf (stderr, "GDBserver (process %d): Cannot exec %s: %s.\n", + getpid (), program, +- errno < sys_nerr ? sys_errlist[errno] : "unknown error"); ++ strerror (errno)); + fflush (stderr); + _exit (0177); + } +diff -urN gdb-5.3/gdb/gdbserver.orig/low-nbsd.c gdb-5.3/gdb/gdbserver/low-nbsd.c +--- gdb-5.3/gdb/gdbserver.orig/low-nbsd.c 2002-01-17 14:13:49.000000000 -0700 ++++ gdb-5.3/gdb/gdbserver/low-nbsd.c 2003-08-20 08:46:27.000000000 -0600 +@@ -137,7 +137,7 @@ + execv (program, allargs); + + fprintf (stderr, "Cannot exec %s: %s.\n", program, +- errno < sys_nerr ? sys_errlist[errno] : "unknown error"); ++ strerror (errno)); + fflush (stderr); + _exit (0177); + } +diff -urN gdb-5.3/gdb/gdbserver.orig/low-sparc.c gdb-5.3/gdb/gdbserver/low-sparc.c +--- gdb-5.3/gdb/gdbserver.orig/low-sparc.c 2002-01-17 14:13:50.000000000 -0700 ++++ gdb-5.3/gdb/gdbserver/low-sparc.c 2003-08-20 08:46:38.000000000 -0600 +@@ -44,7 +44,6 @@ + #include <sys/ptrace.h> + #include <sys/reg.h> + +-extern int sys_nerr; + extern char **sys_errlist; + extern int errno; + +@@ -67,7 +66,7 @@ + execv (program, allargs); + + fprintf (stderr, "Cannot exec %s: %s.\n", program, +- errno < sys_nerr ? sys_errlist[errno] : "unknown error"); ++ strerror (errno)); + fflush (stderr); + _exit (0177); + } +diff -urN gdb-5.3/gdb/gdbserver.orig/low-sun3.c gdb-5.3/gdb/gdbserver/low-sun3.c +--- gdb-5.3/gdb/gdbserver.orig/low-sun3.c 2002-01-17 14:13:50.000000000 -0700 ++++ gdb-5.3/gdb/gdbserver/low-sun3.c 2003-08-20 08:46:51.000000000 -0600 +@@ -41,7 +41,6 @@ + #include <sys/ptrace.h> + #include <machine/reg.h> + +-extern int sys_nerr; + extern char **sys_errlist; + extern int errno; + +@@ -64,7 +63,7 @@ + execv (program, allargs); + + fprintf (stderr, "Cannot exec %s: %s.\n", program, +- errno < sys_nerr ? sys_errlist[errno] : "unknown error"); ++ strerror (errno)); + fflush (stderr); + _exit (0177); + } +diff -urN gdb-5.3/gdb/gdbserver.orig/utils.c gdb-5.3/gdb/gdbserver/utils.c +--- gdb-5.3/gdb/gdbserver.orig/utils.c 2003-08-20 08:47:56.000000000 -0600 ++++ gdb-5.3/gdb/gdbserver/utils.c 2003-08-20 08:48:15.000000000 -0600 +@@ -33,16 +33,13 @@ + 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; @@ -512,3 +617,17 @@ Fix build on Sparc. err = "unknown error"; combined = (char *) alloca (strlen (err) + strlen (string) + 3); +diff -urN gdb-5.3/gdb/gdbserver.orig/linux-low.c.orig gdb-5.3/gdb/gdbserver/linux-low.c.orig +--- gdb-5.3/gdb/gdbserver.orig/linux-low.c 2003-08-20 08:40:27.000000000 -0600 ++++ gdb-5.3/gdb/gdbserver/linux-low.c 2003-08-20 08:44:54.000000000 -0600 +@@ -175,8 +175,7 @@ + if (ptrace (PTRACE_ATTACH, pid, 0, 0) != 0) + { + fprintf (stderr, "Cannot attach to process %d: %s (%d)\n", pid, +- errno < sys_nerr ? sys_errlist[errno] : "unknown error", +- errno); ++ strerror (errno), errno); + fflush (stderr); + + /* If we fail to attach to an LWP, just return. */ + |