Fix to build better with DJGPP.
[openssl.git] / crypto / bio / b_sock.c
index dcaef68ea7cf658677bc3120666a4dc25a439202..a7da2581014275ce32421a11dd3ce0ddb2ee3732 100644 (file)
@@ -83,6 +83,7 @@
 static int wsa_init_done=0;
 #endif
 
+#if 0
 static unsigned long BIO_ghbn_hits=0L;
 static unsigned long BIO_ghbn_miss=0L;
 
@@ -93,6 +94,7 @@ static struct ghbn_cache_st
        struct hostent *ent;
        unsigned long order;
        } ghbn_cache[GHBN_NUM];
+#endif
 
 static int get_ip(const char *str,unsigned char *ip);
 #if 0
@@ -230,6 +232,7 @@ int BIO_sock_error(int sock)
                return(j);
        }
 
+#if 0
 long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)
        {
        int i;
@@ -267,6 +270,7 @@ long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)
                }
        return(1);
        }
+#endif
 
 #if 0
 static struct hostent *ghbn_dup(struct hostent *a)
@@ -463,6 +467,12 @@ int BIO_sock_init(void)
                        }
                }
 #endif /* OPENSSL_SYS_WINDOWS */
+#ifdef WATT32
+       extern int _watt_do_exit;
+       _watt_do_exit = 0;    /* don't make sock_init() call exit() */
+       if (sock_init())
+               return (-1);
+#endif
        return(1);
        }
 
@@ -484,7 +494,11 @@ int BIO_socket_ioctl(int fd, long type, unsigned long *arg)
        {
        int i;
 
+#ifdef __DJGPP__
+       i=ioctlsocket(fd,type,(char *)arg);
+#else
        i=ioctlsocket(fd,type,arg);
+#endif /* __DJGPP__ */
        if (i < 0)
                SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error());
        return(i);