]> git.sur5r.net Git - openldap/commitdiff
In previous commit - change strerror() to STRERROR().
authorHoward Chu <hyc@openldap.org>
Sun, 29 Aug 1999 02:59:29 +0000 (02:59 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 29 Aug 1999 02:59:29 +0000 (02:59 +0000)
Use strerror() if available.

include/ac/errno.h
include/ac/socket.h
servers/slapd/connection.c
servers/slapd/result.c

index a7b10eb5d8a2aa6fc8fd785e44b48d36093c6e3b..26af4a57672874cd66acaf482c4e2cb2deb29b31 100644 (file)
        extern char     *sys_errlist[];
 #endif
 
-#ifndef HAVE_STRERROR
-#define        strerror(err) \
-       (err) > -1 && (err) < sys_nerr ? sys_errlist[(err)] : "unknown"
+#ifdef HAVE_STRERROR
+#define        STRERROR(err)   strerror(err)
+#else
+#define        STRERROR(err) \
+       ((err) > -1 && (err) < sys_nerr ? sys_errlist[(err)] : "unknown")
 #endif
 
 extern char* strerror_r();
index b929dd80c973832ef884605c45c1dcc1cc1bbda0..48bb031a8c6ad32b0ba7224918df340510e81d81 100644 (file)
@@ -97,7 +97,7 @@
 #else
 #      define tcp_close( s )           close( s )
 #      define sock_errno()     errno
-#      define sock_errstr()    strerror(errno)
+#      define sock_errstr()    STRERROR(errno)
 #endif /* MACOS */
 
 #ifndef ioctl_t
index 972a5d0213ba762fabd92f7898322b3ead9b97b6..b554ede05a61921369c4dbca78d5a0ac68f2b4b6 100644 (file)
@@ -921,7 +921,7 @@ connection_input(
 
                Debug( LDAP_DEBUG_TRACE,
                        "ber_get_next on fd %d failed errno=%d (%s)\n",
-                       ber_pvt_sb_get_desc( conn->c_sb ), err, strerror(err) );
+                       ber_pvt_sb_get_desc( conn->c_sb ), err, STRERROR(err) );
                Debug( LDAP_DEBUG_TRACE,
                        "\t*** got %ld of %lu so far\n",
                        (long)(conn->c_currentber->ber_rwptr - conn->c_currentber->ber_buf),
index 563e83aa35b7a8c44ae53acdf265803279f03500..242b72e2d8ca3e523ade9aa03cfa5b7443e1dfcb 100644 (file)
@@ -186,7 +186,7 @@ static long send_ldap_ber(
                 */
 
                Debug( LDAP_DEBUG_CONNS, "ber_flush failed errno=%d reason=\"%s\"\n",
-                   err, strerror(err) );
+                   err, STRERROR(err) );
 
                if ( err != EWOULDBLOCK && err != EAGAIN ) {
                        connection_closing( conn );