summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/gai_strerror.c
diff options
context:
space:
mode:
authorcmetz <>1999-06-23 22:38:52 +0000
committercmetz <>1999-06-23 22:38:52 +0000
commitdb859794a581f4638e6accbed6235a18bc8f74b3 (patch)
tree85b56cd6123a97a0a71c1f443b406754eca70df1 /src/lib/libc/net/gai_strerror.c
parentbb8e4a1e2b3fa93fc2def309cb510f1734df4d77 (diff)
downloadopenbsd-db859794a581f4638e6accbed6235a18bc8f74b3.tar.gz
openbsd-db859794a581f4638e6accbed6235a18bc8f74b3.tar.bz2
openbsd-db859794a581f4638e6accbed6235a18bc8f74b3.zip
Removed portability ifdefs.
Diffstat (limited to 'src/lib/libc/net/gai_strerror.c')
-rw-r--r--src/lib/libc/net/gai_strerror.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/lib/libc/net/gai_strerror.c b/src/lib/libc/net/gai_strerror.c
index a758b7449b..37e0b55e8b 100644
--- a/src/lib/libc/net/gai_strerror.c
+++ b/src/lib/libc/net/gai_strerror.c
@@ -30,33 +30,6 @@
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE. 31 * SUCH DAMAGE.
32 * 32 *
33 * Redistribution and use in source and binary forms, with or without
34 * modification, are permitted provided that the following conditions
35 * are met:
36 * 1. Redistributions of source code must retain the above copyright
37 * notice, this list of conditions and the following disclaimer.
38 * 2. Redistributions in binary form must reproduce the above copyright
39 * notice, this list of conditions and the following disclaimer in the
40 * documentation and/or other materials provided with the distribution.
41 * 3. All advertising materials mentioning features or use of this software
42 * must display the following acknowledgement:
43 * This product includes software developed by Craig Metz and
44 * by other contributors.
45 * 4. Neither the name of the author nor the names of contributors
46 * may be used to endorse or promote products derived from this software
47 * without specific prior written permission.
48 *
49 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59 * SUCH DAMAGE.
60 */ 33 */
61 34
62/* gai_strerror() v1.38 */ 35/* gai_strerror() v1.38 */
@@ -65,12 +38,6 @@
65#include <netdb.h> 38#include <netdb.h>
66#include <errno.h> 39#include <errno.h>
67 40
68#define THREAD_SAFE 0
69
70#if !THREAD_SAFE
71static char buffer[256];
72#endif /* !THREAD_SAFE */
73
74char *gai_strerror(int errnum) 41char *gai_strerror(int errnum)
75{ 42{
76 switch(errnum) { 43 switch(errnum) {
@@ -97,20 +64,8 @@ char *gai_strerror(int errnum)
97 case EAI_MEMORY: 64 case EAI_MEMORY:
98 return "memory allocation failure"; 65 return "memory allocation failure";
99 case EAI_SYSTEM: 66 case EAI_SYSTEM:
100#if THREAD_SAFE
101 return "system error"; 67 return "system error";
102#else /* THREAD_SAFE */
103 snprintf(buffer, sizeof(buffer)-1, "system error: %s(%d)", strerror(errno), errno);
104 buffer[sizeof(buffer)-1] = 0;
105 return buffer;
106#endif /* THREAD_SAFE */
107 default: 68 default:
108#if THREAD_SAFE
109 return "unknown/invalid error"; 69 return "unknown/invalid error";
110#else /* THREAD_SAFE */
111 snprintf(buffer, sizeof(buffer)-1, "unknown/invalid error %d", errnum);
112 buffer[sizeof(buffer)-1] = 0;
113 return buffer;
114#endif /* THREAD_SAFE */
115 }; 70 };
116}; 71};