Reduce header dependencies.
[openssl.git] / crypto / rand / randfile.c
index ad0e55db9047660fffa3906685bb5a0f8c961a27..468da4f874b28296938eb3644b8746915a4b8fac 100644 (file)
@@ -1,5 +1,5 @@
 /* crypto/rand/randfile.c */
-/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
+/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
  * This package is an SSL implementation written
  */
 
 #include <stdio.h>
-#include "cryptlib.h"
+#include <stdlib.h>
+#include <string.h>
+#include <memory.h>
+#include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include "e_os.h"
 #include "rand.h"
 
 #undef BUFSIZE
@@ -69,7 +73,7 @@
 /* #define RFILE ".rand" - defined in ../../e_os.h */
 
 int RAND_load_file(file,bytes)
-char *file;
+const char *file;
 long bytes;
        {
        MS_STATIC unsigned char buf[BUFSIZE];
@@ -86,7 +90,7 @@ long bytes;
        if (i < 0) return(0);
        if (bytes <= 0) return(ret);
 
-       in=fopen(file,"r");
+       in=fopen(file,"rb");
        if (in == NULL) goto err;
        for (;;)
                {
@@ -106,7 +110,7 @@ err:
        }
 
 int RAND_write_file(file)
-char *file;
+const char *file;
        {
        unsigned char buf[BUFSIZE];
        int i,ret=0;