Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Get xbt_init seeding the system random generator
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 17 Jul 2006 17:16:17 +0000 (17:16 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 17 Jul 2006 17:16:17 +0000 (17:16 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@2603 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/module.c

index 652b0c7..f6f079c 100644 (file)
@@ -7,6 +7,8 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include "time.h" /* to seed the random generator */
+
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dynar.h"
 #include "xbt/sysdep.h"
 #include "xbt/log.h"
 #include "xbt/dynar.h"
@@ -38,6 +40,7 @@ xbt_init(int *argc, char **argv) {
     return;
 
   xbt_binary_name = strdup(argv[0]);
     return;
 
   xbt_binary_name = strdup(argv[0]);
+  srand((unsigned int)time(NULL));
   VERB0("Initialize XBT");
   
   xbt_log_init(argc,argv);
   VERB0("Initialize XBT");
   
   xbt_log_init(argc,argv);