Give the correct e-mail address even though the message is not quite serious
[openssl.git] / apps / s_time.c
index c5e3dcd5ae187eac9b3edebf6211b3a6601b64ce..1653195b3f30af2fbaf6424f4b1e846a80d30195 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
-#if defined(NO_RSA) && !defined(NO_SSL2)
-#define NO_SSL2
-#endif
-
 #ifdef NO_STDIO
 #define APPS_WIN16
 #endif
+#define USE_SOCKETS
 #include <openssl/x509.h>
 #include <openssl/ssl.h>
 #include <openssl/pem.h>
-#define USE_SOCKETS
 #include "apps.h"
 #include "s_apps.h"
 #include <openssl/err.h>
 #include "wintext.h"
 #endif
 
-#ifndef MSDOS
+#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC))
 #define TIMES
 #endif
 
-#ifndef VMS
 #ifndef _IRIX
 #include <time.h>
 #endif
 #include <sys/types.h>
 #include <sys/times.h>
 #endif
-#else /* VMS */
-#include <types.h>
-struct tms {
-       time_t tms_utime;
-       time_t tms_stime;
-       time_t tms_uchild;      /* I dunno...  */
-       time_t tms_uchildsys;   /* so these names are a guess :-) */
-       }
+
+/* Depending on the VMS version, the tms structure is perhaps defined.
+   The __TMS macro will show if it was.  If it wasn't defined, we should
+   undefine TIMES, since that tells the rest of the program how things
+   should be handled.                          -- Richard Levitte */
+#if defined(VMS) && defined(__DECC) && !defined(__TMS)
+#undef TIMES
 #endif
+
 #ifndef TIMES
 #include <sys/timeb.h>
 #endif
@@ -125,11 +120,7 @@ struct tms {
 */
 #ifndef HZ
 #ifndef CLK_TCK
-#ifndef VMS
-#define HZ      100.0
-#else /* VMS */
 #define HZ      100.0
-#endif
 #else /* CLK_TCK */
 #define HZ ((double)CLK_TCK)
 #endif
@@ -138,6 +129,7 @@ struct tms {
 #undef PROG
 #define PROG s_time_main
 
+#undef ioctl
 #define ioctl ioctlsocket
 
 #define SSL_CONNECT_NAME       "localhost:4433"
@@ -252,15 +244,6 @@ static int parseArgs(int argc, char **argv)
 
     verify_depth=0;
     verify_error=X509_V_OK;
-#ifdef FIONBIO
-    t_nbio=0;
-#endif
-
-       apps_startup();
-       s_time_init();
-
-       if (bio_err == NULL)
-               bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
 
     argc--;
     argv++;
@@ -415,6 +398,12 @@ int MAIN(int argc, char **argv)
        MS_STATIC char buf[1024*8];
        int ver;
 
+       apps_startup();
+       s_time_init();
+
+       if (bio_err == NULL)
+               bio_err=BIO_new_fp(stderr,BIO_NOCLOSE);
+
 #if !defined(NO_SSL2) && !defined(NO_SSL3)
        s_time_meth=SSLv23_client_method();
 #elif !defined(NO_SSL3)
@@ -668,7 +657,13 @@ static SSL *doConnection(SSL *scon)
                        width=i+1;
                        FD_ZERO(&readfds);
                        FD_SET(i,&readfds);
-                       select(width,&readfds,NULL,NULL,NULL);
+                       /* Note: under VMS with SOCKETSHR the 2nd parameter
+                        * is currently of type (int *) whereas under other
+                        * systems it is (void *) if you don't have a cast it
+                        * will choke the compiler: if you do have a cast then
+                        * you can either go for (int *) or (void *).
+                        */
+                       select(width,(void *)&readfds,NULL,NULL,NULL);
                        continue;
                        }
                break;