diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index f958332..43f9e05 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -146,6 +146,9 @@ static unsigned char md[MD_DIGEST_LENGTH];
 static long md_count[2]={0,0};
 static double entropy=0;
 static int initialized=0;
+#ifndef GETPID_IS_MEANINGLESS
+static pid_t old_pid=0;
+#endif
 
 static unsigned int crypto_lock_rand = 0; /* may be set only when a thread
                                            * holds CRYPTO_LOCK_RAND
@@ -358,6 +361,17 @@ static int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo)
 	EVP_MD_CTX m;
 #ifndef GETPID_IS_MEANINGLESS
 	pid_t curr_pid = getpid();
+        /*
+         * A pid change means we should reseed the RNG.
+         * The easiest way to accomplish this is to set initialized
+         * to zero, this will cause the code further down to call
+         * RAND_poll().
+         */
+	if (curr_pid != old_pid)
+	        {
+		initialized = 0;
+		old_pid = curr_pid;
+		}
 #endif
 	int do_stir_pool = 0;
 
