Incorporate some changes that make OpenSSL compilable in CygWin.
[oweals/openssl.git] / apps / app_rand.c
index 64531df8123d3dd376a074c6f21e2a59fa1c1876..8a78e12eb732855b445c3e56f9f92c25bda2e8c3 100644 (file)
@@ -56,7 +56,7 @@
  * [including the GNU Public Licence.]
  */
 /* ====================================================================
- * Copyright (c) 1998-1999 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 1998-2000 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -177,8 +177,10 @@ long app_RAND_load_files(char *name)
                if (*n == '\0') break;
 
                egd=RAND_egd(n);
-               if (egd > 0) tot+=egd;
-               tot+=RAND_load_file(n,1024L*1024L);
+               if (egd > 0)
+                       tot+=egd;
+               else
+                       tot+=RAND_load_file(n,-1);
                if (last) break;
                }
        if (tot > 512)