This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Use strerror() in linux-low.c
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Tue, 5 Feb 2002 13:51:35 -0500
- Subject: [PATCH] Use strerror() in linux-low.c
A trivial cleanup. sys_nerr/sys_errlist are a deprecated interface, I
believe.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
2002-02-05 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/linux-low.c (create_inferior): Call strerror instead of
grubbing through sys_errlist.
Index: gdbserver/linux-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-low.c,v
retrieving revision 1.1
diff -p -u -r1.1 linux-low.c
--- linux-low.c 2002/02/05 18:44:18 1.1
+++ linux-low.c 2002/02/05 18:48:49
@@ -32,6 +32,7 @@
#include <signal.h>
#include <sys/ioctl.h>
#include <fcntl.h>
+#include <string.h>
/***************Begin MY defs*********************/
static char my_registers[REGISTER_BYTES];
@@ -70,7 +71,7 @@ create_inferior (char *program, char **a
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);
}