Incorporate some changes that make OpenSSL compilable in CygWin.
[oweals/openssl.git] / apps / app_rand.c
index c5d66a3b5fafedf22a705d04629c361638e971ad..8a78e12eb732855b445c3e56f9f92c25bda2e8c3 100644 (file)
@@ -152,8 +152,8 @@ int app_RAND_load_file(const char *file, BIO *bio_e, int dont_warn)
                                BIO_printf(bio_e,"Consider setting the RANDFILE environment variable to point at a file that\n");
                                BIO_printf(bio_e,"'random' data can be kept in (the file will be overwritten).\n");
                                }
-                       return 0;
                        }
+               return 0;
                }
        seeded = 1;
        return 1;
@@ -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,-1);
+               if (egd > 0)
+                       tot+=egd;
+               else
+                       tot+=RAND_load_file(n,-1);
                if (last) break;
                }
        if (tot > 512)