[Sheepdog] [PATCH] collie: set the seed for random()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Apr 13 10:25:42 CEST 2010


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 collie/collie.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/collie/collie.c b/collie/collie.c
index 796807f..9ab14de 100644
--- a/collie/collie.c
+++ b/collie/collie.c
@@ -12,6 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
+#include <time.h>
 #include <linux/limits.h>
 #include <sys/syslog.h>
 
@@ -94,6 +95,8 @@ int main(int argc, char **argv)
 
 	snprintf(path, sizeof(path), "%s/" LOG_FILE_NAME, dir);
 
+	srandom(port);
+
 	ret = init_store(dir);
 	if (ret)
 		exit(1);
-- 
1.5.6.5




More information about the sheepdog mailing list