gdb/
[binutils-gdb.git] / gdb / gdbserver / utils.c
index e13eda80d46157496a8f57b367d726b21a3d184b..ec7ed7c0c991932b5f0701859bd08a6559fab7af 100644 (file)
@@ -1,5 +1,5 @@
 /* General utility routines for the remote server for GDB.
-   Copyright 1986, 1989, 1993, 1995, 1996, 1997, 1999, 2000, 2002
+   Copyright (C) 1986, 1989, 1993, 1995, 1996, 1997, 1999, 2000, 2002, 2003
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -16,8 +16,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
 
 #include "server.h"
 #include <stdio.h>
@@ -33,16 +33,13 @@ 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;
 
-  if (errno < sys_nerr)
-    err = sys_errlist[errno];
-  else
+  err = strerror (errno);
+  if (err == NULL)
     err = "unknown error";
 
   combined = (char *) alloca (strlen (err) + strlen (string) + 3);