ifdef cleanup part 3: OPENSSL_SYSNAME
[openssl.git] / apps / apps.c
index b6549d5040399056ad316f82b5624107ddf70975..97f0c0e182b36959f1c0df8a56b1d8e8d42fd991 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#if !defined(OPENSSL_SYSNAME_WIN32) && !defined(OPENSSL_SYSNAME_WINCE) && !defined(NETWARE_CLIB)
+#if !defined(OPENSSL_SYS_WIN32) && !defined(OPENSSL_SYS_WINCE) && !defined(NETWARE_CLIB)
 # include <strings.h>
 #endif
 #include <sys/types.h>
@@ -852,11 +852,7 @@ X509 *load_cert(BIO *err, const char *file, int format,
     }
 
     if (file == NULL) {
-#ifdef _IONBF
-# ifndef OPENSSL_NO_SETVBUF_IONBF
-        setvbuf(stdin, NULL, _IONBF, 0);
-# endif                         /* ndef OPENSSL_NO_SETVBUF_IONBF */
-#endif
+        setbuf(stdin, NULL); /* don't do buffered reads */
         BIO_set_fp(cert, stdin, BIO_NOCLOSE);
     } else {
         if (BIO_read_filename(cert, file) <= 0) {
@@ -980,11 +976,7 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
         goto end;
     }
     if (file == NULL && maybe_stdin) {
-#ifdef _IONBF
-# ifndef OPENSSL_NO_SETVBUF_IONBF
-        setvbuf(stdin, NULL, _IONBF, 0);
-# endif                         /* ndef OPENSSL_NO_SETVBUF_IONBF */
-#endif
+        setbuf(stdin, NULL); /* don't do buffered reads */
         BIO_set_fp(key, stdin, BIO_NOCLOSE);
     } else if (BIO_read_filename(key, file) <= 0) {
         BIO_printf(err, "Error opening %s %s\n", key_descrip, file);
@@ -1058,11 +1050,7 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin,
         goto end;
     }
     if (file == NULL && maybe_stdin) {
-#ifdef _IONBF
-# ifndef OPENSSL_NO_SETVBUF_IONBF
-        setvbuf(stdin, NULL, _IONBF, 0);
-# endif                         /* ndef OPENSSL_NO_SETVBUF_IONBF */
-#endif
+        setbuf(stdin, NULL); /* don't do buffered reads */
         BIO_set_fp(key, stdin, BIO_NOCLOSE);
     } else if (BIO_read_filename(key, file) <= 0) {
         BIO_printf(err, "Error opening %s %s\n", key_descrip, file);
@@ -1643,7 +1631,7 @@ BIGNUM *load_serial(char *serialfile, int create, ASN1_INTEGER **retai)
 {
     BIO *in = NULL;
     BIGNUM *ret = NULL;
-    MS_STATIC char buf[1024];
+    char buf[1024];
     ASN1_INTEGER *ai = NULL;
 
     ai = ASN1_INTEGER_new();