ec/ecp_nistz256.c: harmonize with latest indent script.
[oweals/openssl.git] / crypto / bio / b_sock.c
index 4544ab209c75d914a5dfb99d32a22b12072110ba..f7e95ee5c525e557dc77e090734cfff25f0c6d85 100644 (file)
@@ -150,8 +150,7 @@ int BIO_get_host_ip(const char *str, unsigned char *ip)
                goto err;
                }
 
-       /* cast to short because of win16 winsock definition */
-       if ((short)he->h_addrtype != AF_INET)
+       if (he->h_addrtype != AF_INET)
                {
                BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_GETHOSTBYNAME_ADDR_IS_NOT_AF_INET);
                goto err;
@@ -235,10 +234,6 @@ int BIO_sock_error(int sock)
        int j,i;
        union { size_t s; int i; } size;
                 
-#if defined(OPENSSL_SYS_BEOS_R5)
-       return 0;
-#endif
        /* heuristic way to adapt for platforms that expect 64-bit optlen */
        size.s=0, size.i=sizeof(j);
        /* Note: under Windows the third parameter is of type (char *)
@@ -494,6 +489,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
 
 #if defined(OPENSSL_SYS_NETWARE) && !defined(NETWARE_BSDSOCK)
     WORD wVerReq;
@@ -543,8 +544,12 @@ int BIO_socket_ioctl(int fd, long type, void *arg)
        {
        int i;
 
+#ifdef __DJGPP__
+       i=ioctlsocket(fd,type,(char *)arg);
+#else
 # if defined(OPENSSL_SYS_VMS)
-       /* 2011-02-18 SMS.
+       /*-
+        * 2011-02-18 SMS.
         * VMS ioctl() can't tolerate a 64-bit "void *arg", but we
         * observe that all the consumers pass in an "unsigned long *",
         * so we arrange a local copy with a short pointer, and use
@@ -565,8 +570,9 @@ int BIO_socket_ioctl(int fd, long type, void *arg)
 # else /* defined(OPENSSL_SYS_VMS) */
 #  define ARG arg
 # endif /* defined(OPENSSL_SYS_VMS) [else] */
-       i=ioctlsocket(fd,type,ARG);
 
+       i=ioctlsocket(fd,type,ARG);
+#endif /* __DJGPP__ */
        if (i < 0)
                SYSerr(SYS_F_IOCTLSOCKET,get_last_socket_error());
        return(i);