X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7a8cd62135619ad52e05ae1c929ef07e166e4260..347996b4a10c4e8579080692afa60e0afb88b60a:/examples/msg/bittorrent/tracker.c diff --git a/examples/msg/bittorrent/tracker.c b/examples/msg/bittorrent/tracker.c index d6190473a6..72ff0d1f67 100644 --- a/examples/msg/bittorrent/tracker.c +++ b/examples/msg/bittorrent/tracker.c @@ -1,10 +1,11 @@ -/* Copyright (c) 2012. 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 +#include #include static void task_free(void *data); @@ -19,12 +20,11 @@ int tracker(int argc, char *argv[]) { int i; - RngStream stream = RngStream_CreateStream("tracker"); - + 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); @@ -78,8 +78,6 @@ int tracker(int argc, char *argv[]) } //Free the peers list xbt_dynar_free(&peers_list); - //Free the RngStream object. - RngStream_DeleteStream(&stream); XBT_INFO("Tracker is leaving");