From db721ca82147ff4eea81629358cdacecfbd05d93 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 29 Mar 1999 05:28:29 +0000 Subject: [PATCH] Add ioctl_t for arg type (Unix requires 'int', Winsock requires 'u_long'). --- include/ac/socket.h | 5 +++++ libraries/liblber/sockbuf.c | 2 +- libraries/libldap/os-ip.c | 2 +- servers/slapd/daemon.c | 6 ------ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/ac/socket.h b/include/ac/socket.h index 466cccd442..c49226fcc1 100644 --- a/include/ac/socket.h +++ b/include/ac/socket.h @@ -66,6 +66,7 @@ #ifdef HAVE_WINSOCK # define tcp_close( s ) closesocket( s ); # define ioctl( s, c, a ) ioctlsocket( (s), (c), (a) ) +# define ioctl_t u_long #elif MACOS # define tcp_close( s ) tcpclose( s ) #elif DOS @@ -79,6 +80,10 @@ # define tcp_close( s ) close( s ) #endif /* MACOS */ +#ifndef ioctl_t +# define ioctl_t int +#endif + #if !defined(__alpha) || defined(VMS) #define AC_HTONL( l ) htonl( l ) #define AC_NTOHL( l ) ntohl( l ) diff --git a/libraries/liblber/sockbuf.c b/libraries/liblber/sockbuf.c index 1b4adad44d..f34f457112 100644 --- a/libraries/liblber/sockbuf.c +++ b/libraries/liblber/sockbuf.c @@ -580,7 +580,7 @@ int lber_pvt_sb_set_nonblock( Sockbuf *sb, int nb ) #ifdef FIONBIO if (lber_pvt_sb_in_use(sb)) { /* WINSOCK requires the status to be a long */ - u_long status = (nb!=0); + ioctl_t status = (nb!=0); if (ioctl( lber_pvt_sb_get_desc(sb), FIONBIO, &status ) == -1 ) { return -1; } diff --git a/libraries/libldap/os-ip.c b/libraries/libldap/os-ip.c index 41f3dd1787..54e068b2a1 100644 --- a/libraries/libldap/os-ip.c +++ b/libraries/libldap/os-ip.c @@ -49,7 +49,7 @@ ldap_connect_to_host( Sockbuf *sb, char *host, unsigned long address, struct hostent *hp = NULL; #ifdef notyet #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS - int status; /* for ioctl call */ + ioctl_t status; /* for ioctl call */ #endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */ #endif /* notyet */ diff --git a/servers/slapd/daemon.c b/servers/slapd/daemon.c index 0f3c859860..8ef532f043 100644 --- a/servers/slapd/daemon.c +++ b/servers/slapd/daemon.c @@ -13,12 +13,6 @@ #include "ldapconfig.h" #include "slap.h" -#ifdef HAVE_SYS_FILIO_H -#include -#elif HAVE_SYS_IOCTL_H -#include -#endif - #ifdef HAVE_TCPD #include -- 2.39.5