From: Howard Chu Date: Sun, 29 Aug 1999 02:54:58 +0000 (+0000) Subject: per Hallvard's advice: fixed definition of sock_errstr(). X-Git-Tag: TWEB_OL_BASE~86 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=801bac51c9e024ae31d00cefeb2d28d284f720aa;p=openldap per Hallvard's advice: fixed definition of sock_errstr(). --- diff --git a/include/ac/socket.h b/include/ac/socket.h index 316b89a924..b929dd80c9 100644 --- a/include/ac/socket.h +++ b/include/ac/socket.h @@ -78,7 +78,7 @@ #define ETIMEDOUT WSAETIMEDOUT #define sock_errno() WSAGetLastError() -#define sock_errstr(err) WSAGetLastErrorString() +#define sock_errstr() WSAGetLastErrorString() #elif MACOS # define tcp_close( s ) tcpclose( s ) @@ -97,7 +97,7 @@ #else # define tcp_close( s ) close( s ) # define sock_errno() errno -# define sock_errstr(err) strerror(err) +# define sock_errstr() strerror(errno) #endif /* MACOS */ #ifndef ioctl_t diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index b9a0b82221..95a2689731 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -279,7 +279,7 @@ open_listener( int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: socket() failed errno=%d (%s)\n", err, - sock_errstr(err), 0 ); + sock_errstr(), 0 ); return NULL; } @@ -302,7 +302,7 @@ open_listener( int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(SO_REUSEADDR) failed errno=%d (%s)\n", - (long) l.sl_sd, err, sock_errstr(err) ); + (long) l.sl_sd, err, sock_errstr() ); } #endif #ifdef SO_KEEPALIVE @@ -314,7 +314,7 @@ open_listener( int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(SO_KEEPALIVE) failed errno=%d (%s)\n", - (long) l.sl_sd, err, sock_errstr(err) ); + (long) l.sl_sd, err, sock_errstr() ); } #endif #ifdef TCP_NODELAY @@ -326,14 +326,14 @@ open_listener( int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "slapd(%ld): setsockopt(TCP_NODELAY) failed errno=%d (%s)\n", - (long) l.sl_sd, err, sock_errstr(err) ); + (long) l.sl_sd, err, sock_errstr() ); } #endif if ( bind( l.sl_sd, (struct sockaddr *) &l.sl_addr, sizeof(l.sl_addr) ) == -1 ) { int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n", - (long) l.sl_sd, err, sock_errstr(err) ); + (long) l.sl_sd, err, sock_errstr() ); tcp_close( l.sl_sd ); return NULL; } @@ -397,7 +397,7 @@ int slapd_daemon_init(char *urls, int port, int tls_port ) int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: socket() failed errno=%d (%s)\n", err, - sock_errstr(err), 0 ); + sock_errstr(), 0 ); return sel_exit_fd; } else { struct sockaddr_in si; @@ -414,7 +414,7 @@ int slapd_daemon_init(char *urls, int port, int tls_port ) { err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: bind(%ld) failed errno=%d (%s)\n", - (long) sel_exit_fd, err, sock_errstr(err) ); + (long) sel_exit_fd, err, sock_errstr() ); tcp_close( sel_exit_fd ); return rc; } @@ -422,7 +422,7 @@ int slapd_daemon_init(char *urls, int port, int tls_port ) { err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: getsockname(%ld) failed errno=%d (%s)\n", - (long) sel_exit_fd, err, sock_errstr(err) ); + (long) sel_exit_fd, err, sock_errstr() ); tcp_close( sel_exit_fd ); return rc; } @@ -430,7 +430,7 @@ int slapd_daemon_init(char *urls, int port, int tls_port ) { err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: connect(%ld) failed errno=%d (%s)\n", - (long) sel_exit_fd, err, sock_errstr(err) ); + (long) sel_exit_fd, err, sock_errstr() ); tcp_close( sel_exit_fd ); return rc; } @@ -515,7 +515,7 @@ slapd_daemon_task( Debug( LDAP_DEBUG_ANY, "daemon: listen(%s, 5) failed errno=%d (%s)\n", (long) slap_listeners[l]->sl_url, err, - sock_errstr(err) ); + sock_errstr() ); return( (void*)-1 ); } @@ -635,7 +635,7 @@ slapd_daemon_task( if( err != EINTR ) { Debug( LDAP_DEBUG_CONNS, "daemon: select failed (%d): %s\n", - err, sock_errstr(err), 0 ); + err, sock_errstr(), 0 ); slapd_shutdown = -1; } @@ -685,7 +685,7 @@ slapd_daemon_task( Debug( LDAP_DEBUG_ANY, "daemon: accept(%ld) failed errno=%d (%s)\n", (long) slap_listeners[l]->sl_sd, err, - sock_errstr(err) ); + sock_errstr() ); continue; } @@ -721,7 +721,7 @@ slapd_daemon_task( int err = sock_errno(); Debug( LDAP_DEBUG_ANY, "daemon: getpeername( %ld ) failed: errno=%d (%s)\n", - (long) s, err, sock_errstr(err) ); + (long) s, err, sock_errstr() ); slapd_close(s); continue; }