aboutsummaryrefslogtreecommitdiff
path: root/src/dht/test_dht_2dtorus.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/dht/test_dht_2dtorus.c')
-rw-r--r--src/dht/test_dht_2dtorus.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/dht/test_dht_2dtorus.c b/src/dht/test_dht_2dtorus.c
index cc2520580..1cc0e7980 100644
--- a/src/dht/test_dht_2dtorus.c
+++ b/src/dht/test_dht_2dtorus.c
@@ -103,8 +103,6 @@ static GNUNET_SCHEDULER_TaskIdentifier shutdown_handle;
103 103
104static char *topology_file; 104static char *topology_file;
105 105
106static char *data_filename;
107
108struct GNUNET_TESTING_Daemon *d1; 106struct GNUNET_TESTING_Daemon *d1;
109 107
110struct GNUNET_TESTING_Daemon *d2; 108struct GNUNET_TESTING_Daemon *d2;
@@ -472,6 +470,7 @@ run (void *cls, char *const *args, const char *cfgfile,
472{ 470{
473 char *temp_str; 471 char *temp_str;
474 struct GNUNET_TESTING_Host *hosts; 472 struct GNUNET_TESTING_Host *hosts;
473 char *data_filename;
475 474
476 ok = 1; 475 ok = 1;
477 testing_cfg = GNUNET_CONFIGURATION_dup (cfg); 476 testing_cfg = GNUNET_CONFIGURATION_dup (cfg);
@@ -509,27 +508,23 @@ run (void *cls, char *const *args, const char *cfgfile,
509 return; 508 return;
510 } 509 }
511 510
512 if (GNUNET_OK != 511 if (GNUNET_OK ==
513 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_dht_2dtorus", 512 GNUNET_CONFIGURATION_get_value_string (testing_cfg, "test_dht_2dtorus",
514 "data_output_file", 513 "data_output_file",
515 &data_filename)) 514 &data_filename))
516 { 515 {
517 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 516 data_file =
518 "Option test_dht_2d:data_output_file is required!\n");
519 return;
520 }
521
522 data_file =
523 GNUNET_DISK_file_open (data_filename, 517 GNUNET_DISK_file_open (data_filename,
524 GNUNET_DISK_OPEN_READWRITE | 518 GNUNET_DISK_OPEN_READWRITE |
525 GNUNET_DISK_OPEN_CREATE, 519 GNUNET_DISK_OPEN_CREATE,
526 GNUNET_DISK_PERM_USER_READ | 520 GNUNET_DISK_PERM_USER_READ |
527 GNUNET_DISK_PERM_USER_WRITE); 521 GNUNET_DISK_PERM_USER_WRITE);
528 if (data_file == NULL) 522 if (data_file == NULL)
529 { 523 {
530 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n", 524 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Failed to open %s for output!\n",
531 data_filename); 525 data_filename);
532 GNUNET_free (data_filename); 526 GNUNET_free (data_filename);
527 }
533 } 528 }
534 529
535 if (GNUNET_YES == 530 if (GNUNET_YES ==