Add missing include
[oweals/gnunet.git] / src / hostlist / test_gnunet_daemon_hostlist_reconnect.c
index 199040346881758f119202256404927b180e5719..21b2973dee83545e52aa1fa8a4284ecc39b56acf 100644 (file)
@@ -198,29 +198,17 @@ run (void *cls, char *const *args, const char *cfgfile,
 }
 
 
-static int
-check ()
+int
+main (int argcx, char *argvx[])
 {
-  char *const argv[] = { "test-gnunet-daemon-hostlist",
+  static char *const argv[] = {
+    "test-gnunet-daemon-hostlist",
     "-c", "test_gnunet_daemon_hostlist_data.conf",
     NULL
   };
-  struct GNUNET_GETOPT_CommandLineOption options[] = {
+  static struct GNUNET_GETOPT_CommandLineOption options[] = {
     GNUNET_GETOPT_OPTION_END
   };
-  ok = 1;
-  GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
-                      "test-gnunet-daemon-hostlist", "nohelp", options, &run,
-                      &ok);
-  return ok;
-}
-
-
-int
-main (int argc, char *argv[])
-{
-
-  int ret;
 
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
@@ -228,18 +216,24 @@ main (int argc, char *argv[])
   GNUNET_log_setup ("test-gnunet-daemon-hostlist",
                     "WARNING",
                     NULL);
-  ret = check ();
-  if (ret == 0)
+  ok = 1;
+  GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
+                      "test-gnunet-daemon-hostlist", "nohelp", options, &run,
+                      &ok);
+  if (0 == ok)
   {
     FPRINTF (stderr, "%s",  ".");
     /* now do it again */
-    ret = check ();
+    ok = 1;
+    GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv,
+                       "test-gnunet-daemon-hostlist", "nohelp", options, &run,
+                       &ok);
     FPRINTF (stderr, "%s",  ".\n");
   }
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1");
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2");
   GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-3");
-  return ret;
+  return ok;
 }
 
 /* end of test_gnunet_daemon_hostlist_reconnect.c */