Fix for non-monolithic build.
[openssl.git] / apps / app_rand.c
index ea35bf9b1d712ae5687b51314e774379c671efd6..9835c84ed00d4fccb4b90953c271def2f9d9a582 100644 (file)
  *
  */
 
+#define NON_MAIN
 #include "apps.h"
+#undef NON_MAIN
 #include <openssl/bio.h>
 #include <openssl/rand.h>
 
@@ -162,7 +164,8 @@ long app_RAND_load_files(char *name)
        char *p,*n;
        int last;
        long tot=0;
-
+    int egd;
+       
        for (;;)
                {
                last=0;
@@ -173,7 +176,8 @@ long app_RAND_load_files(char *name)
                name=p+1;
                if (*n == '\0') break;
 
-               tot+=RAND_egd(n);
+        egd=RAND_egd(n);
+               if (egd > 0) tot+=egd;
                tot+=RAND_load_file(n,1024L*1024L);
                if (last) break;
                }