aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_sock.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2003-11-28 13:10:58 +0000
committerRichard Levitte <levitte@openssl.org>2003-11-28 13:10:58 +0000
commit4d8743f490a5f96fa26d41985ee12cb6b9815a4c (patch)
tree9668a30c8c9bcc3347eddb5b553d8f1c6ccc8524 /crypto/bio/b_sock.c
parent4c8b4f9d03fb5db99fa22b235369b96039f60706 (diff)
downloadopenssl-4d8743f490a5f96fa26d41985ee12cb6b9815a4c.tar.gz
Netware-specific changes,
PR: 780 Submitted by: Verdon Walker <VWalker@novell.com> Reviewed by: Richard Levitte
Diffstat (limited to 'crypto/bio/b_sock.c')
-rw-r--r--crypto/bio/b_sock.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index c501008028..d619bcf995 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -79,7 +79,7 @@
#define MAX_LISTEN 32
#endif
-#ifdef OPENSSL_SYS_WINDOWS
+#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE)
static int wsa_init_done=0;
#endif
@@ -473,6 +473,31 @@ int BIO_sock_init(void)
if (sock_init())
return (-1);
#endif
+
+#if defined(OPENSSL_SYS_NETWARE)
+ WORD wVerReq;
+ WSADATA wsaData;
+ int err;
+
+ if (!wsa_init_done)
+ {
+
+# ifdef SIGINT
+ signal(SIGINT,(void (*)(int))BIO_sock_cleanup);
+# endif
+
+ wsa_init_done=1;
+ wVerReq = MAKEWORD( 2, 0 );
+ err = WSAStartup(wVerReq,&wsaData);
+ if (err != 0)
+ {
+ SYSerr(SYS_F_WSASTARTUP,err);
+ BIOerr(BIO_F_BIO_SOCK_INIT,BIO_R_WSASTARTUP);
+ return(-1);
+ }
+ }
+#endif
+
return(1);
}
@@ -487,6 +512,12 @@ void BIO_sock_cleanup(void)
#endif
WSACleanup();
}
+#elif defined(OPENSSL_SYS_NETWARE)
+ if (wsa_init_done)
+ {
+ wsa_init_done=0;
+ WSACleanup();
+ }
#endif
}