diff options
author | Richard Levitte <levitte@openssl.org> | 2003-11-28 13:10:58 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2003-11-28 13:10:58 +0000 |
commit | 4d8743f490a5f96fa26d41985ee12cb6b9815a4c (patch) | |
tree | 9668a30c8c9bcc3347eddb5b553d8f1c6ccc8524 /crypto/bio | |
parent | 4c8b4f9d03fb5db99fa22b235369b96039f60706 (diff) |
Netware-specific changes,
PR: 780
Submitted by: Verdon Walker <VWalker@novell.com>
Reviewed by: Richard Levitte
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/b_sock.c | 33 | ||||
-rw-r--r-- | crypto/bio/bss_file.c | 15 | ||||
-rw-r--r-- | crypto/bio/bss_log.c | 2 | ||||
-rw-r--r-- | crypto/bio/bss_sock.c | 2 |
4 files changed, 49 insertions, 3 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 } diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 1f9bd3312a..774bc5a7e7 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -218,6 +218,13 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) _setmode(fd,_O_TEXT); else _setmode(fd,_O_BINARY); +#elif defined(OPENSSL_SYS_NETWARE) && defined(NETWARE_CLIB) + /* Under CLib there are differences in file modes + */ + if (num & BIO_FP_TEXT) + _setmode(fileno((FILE *)ptr),O_TEXT); + else + _setmode(fileno((FILE *)ptr),O_BINARY); #elif defined(OPENSSL_SYS_MSDOS) { int fd = fileno((FILE*)ptr); @@ -270,7 +277,13 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) else strcat(p,"t"); #endif - fp=fopen(ptr,p); +#if defined(OPENSSL_SYS_NETWARE) + if (!(num & BIO_FP_TEXT)) + strcat(p,"b"); + else + strcat(p,"t"); +#endif +fp=fopen(ptr,p); if (fp == NULL) { SYSerr(SYS_F_FOPEN,get_last_sys_error()); diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index 1eb678cac0..6360dbc820 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -78,6 +78,8 @@ # include <starlet.h> #elif defined(__ultrix) # include <sys/syslog.h> +#elif defined(OPENSSL_SYS_NETWARE) +# define NO_SYSLOG #elif (!defined(MSDOS) || defined(WATT32)) && !defined(OPENSSL_SYS_VXWORKS) && !defined(NO_SYSLOG) # include <syslog.h> #endif diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c index 7207a1fb87..472dd75821 100644 --- a/crypto/bio/bss_sock.c +++ b/crypto/bio/bss_sock.c @@ -246,7 +246,7 @@ int BIO_sock_non_fatal_error(int err) { switch (err) { -#if defined(OPENSSL_SYS_WINDOWS) +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_NETWARE) # if defined(WSAEWOULDBLOCK) case WSAEWOULDBLOCK: # endif |