summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-04 06:16:40 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-04 06:16:40 +0000
commit754f65763937c4ebb03dc8a2f4d6eb6f7bd67be2 (patch)
tree3a7bd502ca18723cbf4b9cf63acc2ee2cc63ba9a
parent468946739b3f7e6031d4843fc9a9d5a6e8a16114 (diff)
downloadglibc-754f65763937c4ebb03dc8a2f4d6eb6f7bd67be2.tar.gz
glibc-754f65763937c4ebb03dc8a2f4d6eb6f7bd67be2.tar.xz
glibc-754f65763937c4ebb03dc8a2f4d6eb6f7bd67be2.zip
Update.
2001-04-03  Ulrich Drepper  <drepper@redhat.com>

	* resolv/netdb.h (gai_strerror): Make return value const.
	* sysdeps/generic/gai_strerror.c (gai_strerror): Likewise.
	* sysdeps/posix/gai_strerror.c (gai_strerror): Likewise.
	Add strings for new error values.
-rw-r--r--ChangeLog7
-rw-r--r--resolv/netdb.h2
-rw-r--r--sysdeps/generic/gai_strerror.c4
-rw-r--r--sysdeps/posix/gai_strerror.c15
4 files changed, 20 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index b6ac4f1106..f3baabbf8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2001-04-03  Ulrich Drepper  <drepper@redhat.com>
+
+	* resolv/netdb.h (gai_strerror): Make return value const.
+	* sysdeps/generic/gai_strerror.c (gai_strerror): Likewise.
+	* sysdeps/posix/gai_strerror.c (gai_strerror): Likewise.
+	Add strings for new error values.
+
 2001-03-29  Michael Keezer  <mkeezer@redhat.com>
 
 	* posix/tst-gnuglob.c: Added ifdef _DIRENT_HAVE_D_TYPE.
diff --git a/resolv/netdb.h b/resolv/netdb.h
index 09ca37bbbf..e54c974f2f 100644
--- a/resolv/netdb.h
+++ b/resolv/netdb.h
@@ -482,7 +482,7 @@ extern int getaddrinfo (__const char *__restrict __name,
 extern void freeaddrinfo (struct addrinfo *__ai) __THROW;
 
 /* Convert error return from getaddrinfo() to a string.  */
-extern char *gai_strerror (int __ecode) __THROW;
+extern __const char *gai_strerror (int __ecode) __THROW;
 
 /* Translate a socket address to a location and service name.  */
 extern int getnameinfo (__const struct sockaddr *__restrict __sa,
diff --git a/sysdeps/generic/gai_strerror.c b/sysdeps/generic/gai_strerror.c
index b63f0e2623..a2c9d8faeb 100644
--- a/sysdeps/generic/gai_strerror.c
+++ b/sysdeps/generic/gai_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,7 +19,7 @@
 #include <errno.h>
 #include <netdb.h>
 
-char *
+const char *
 gai_strerror (int code)
 {
   static char buffer[128];
diff --git a/sysdeps/posix/gai_strerror.c b/sysdeps/posix/gai_strerror.c
index 490cd5bc57..b4381eb373 100644
--- a/sysdeps/posix/gai_strerror.c
+++ b/sysdeps/posix/gai_strerror.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
 
@@ -38,16 +38,21 @@ values[] =
     { EAI_NONAME, N_("Name or service not known") },
     { EAI_SERVICE, N_("Servname not supported for ai_socktype") },
     { EAI_SOCKTYPE, N_("ai_socktype not supported") },
-    { EAI_SYSTEM, N_("System error") }
+    { EAI_SYSTEM, N_("System error") },
+    { EAI_INPROGRESS, N_("Processing request in progress") },
+    { EAI_CANCELED, N_("Request canceled") },
+    { EAI_NOTCANCELED, N_("Request not canceled") },
+    { EAI_ALLDONE, N_("All requests done") },
+    { EAI_INTR, N_("Interrupted by a signal") }
   };
 
-char *
+const char *
 gai_strerror (int code)
 {
   size_t i;
   for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i)
     if (values[i].code == code)
-      return (char *) values[i].msg;
+      return _(values[i].msg);
 
-  return (char *) _("Unknown error");
+  return _("Unknown error");
 }