X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fhostlist%2Ftest_gnunet_daemon_hostlist_reconnect.c;h=6b38ffe19dc61006a4b219951009bddce2a2daa2;hb=6fd0a7efde08115b568b99b7755861a50f1b6c2e;hp=199040346881758f119202256404927b180e5719;hpb=9f36a60e41f9a5e7b3f2b2e71245955e390d125d;p=oweals%2Fgnunet.git diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 199040346..6b38ffe19 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c @@ -153,7 +153,7 @@ waitpid_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct PeerContext *p = cls; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Killing ARM process.\n"); - if (0 != GNUNET_OS_process_kill (p->arm_proc, SIGTERM)) + if (0 != GNUNET_OS_process_kill (p->arm_proc, GNUNET_TERM_SIG)) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); @@ -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 */