Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #2 from mquinson/master
[simgrid.git] / examples / msg / bittorrent / tracker.c
index e60ef77..72ff0d1 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2012-2014. The SimGrid Team.
+/* Copyright (c) 2012-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* 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 "tracker.h"
-#include <msg/msg.h>
+#include <simgrid/msg.h>
 #include <xbt/RngStream.h>
 
 static void task_free(void *data);
@@ -20,12 +20,11 @@ int tracker(int argc, char *argv[])
 {
   int i;
 
-  RngStream stream = MSG_host_get_data(MSG_host_self());
-
+  RngStream stream = (RngStream) MSG_host_get_property_value(MSG_host_self(), "stream");
   //Checking arguments
   xbt_assert(argc == 2, "Wrong number of arguments for the tracker.");
   //Retrieving end time
-  double deadline = atof(argv[1]);
+  double deadline = xbt_str_parse_double(argv[1],"Invalid deadline: %s");
   xbt_assert(deadline > 0, "Wrong deadline supplied");
   //Building peers array
   xbt_dynar_t peers_list = xbt_dynar_new(sizeof(int), NULL);