{
p->cfg = GNUNET_CONFIGURATION_create ();
#if START_ARM
- p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
- "gnunet-service-arm",
+ p->arm_proc =
+ GNUNET_OS_start_process (GNUNET_YES, NULL, NULL, "gnunet-service-arm",
+ "gnunet-service-arm",
#if VERBOSE
- "-L", "DEBUG",
+ "-L", "DEBUG",
#endif
- "-c", cfgname, NULL);
+ "-c", cfgname, NULL);
#endif
GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
}
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");
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "ARM process %u stopped\n",
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n",
GNUNET_OS_process_get_pid (p->arm_proc));
GNUNET_OS_process_close (p->arm_proc);
p->arm_proc = NULL;
static void
do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
{
- fprintf (stderr, "Operation timed out\n");
+ FPRINTF (stderr, "%s", "Operation timed out\n");
kill_task = GNUNET_SCHEDULER_NO_TASK;
abort_sks_search_task (NULL, tc);
abort_ksk_search_task (NULL, tc);
case GNUNET_FS_STATUS_SEARCH_RESULT:
if (sks_search == event->value.search.sc)
{
- if (!GNUNET_FS_uri_test_equal (sks_expect_uri,
- event->value.search.specifics.result.uri))
+ if (!GNUNET_FS_uri_test_equal
+ (sks_expect_uri, event->value.search.specifics.result.uri))
{
- fprintf (stderr, "Wrong result for sks search!\n");
+ FPRINTF (stderr, "%s", "Wrong result for sks search!\n");
err = 1;
}
/* give system 1ms to initiate update search! */
}
else if (ksk_search == event->value.search.sc)
{
- if (!GNUNET_FS_uri_test_equal (ksk_expect_uri,
- event->value.search.specifics.result.uri))
+ if (!GNUNET_FS_uri_test_equal
+ (ksk_expect_uri, event->value.search.specifics.result.uri))
{
- fprintf (stderr, "Wrong result for ksk search!\n");
+ FPRINTF (stderr, "%s", "Wrong result for ksk search!\n");
err = 1;
}
- GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task,
- NULL,
+ GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
}
else
{
- fprintf (stderr, "Unexpected search result received!\n");
+ FPRINTF (stderr, "%s", "Unexpected search result received!\n");
GNUNET_break (0);
}
break;
case GNUNET_FS_STATUS_SEARCH_ERROR:
- fprintf (stderr,
- "Error searching file: %s\n",
+ FPRINTF (stderr, "Error searching file: %s\n",
event->value.search.specifics.error.message);
if (sks_search == event->value.search.sc)
- GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task,
- NULL,
+ GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
else if (ksk_search == event->value.search.sc)
- GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task,
- NULL,
+ GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL,
GNUNET_SCHEDULER_REASON_PREREQ_DONE);
else
GNUNET_break (0);
case GNUNET_FS_STATUS_SEARCH_STOPPED:
return NULL;
default:
- fprintf (stderr, "Unexpected event: %d\n", event->status);
+ FPRINTF (stderr, "Unexpected event: %d\n", event->status);
break;
}
return event->value.search.cctx;
if (NULL != emsg)
{
- fprintf (stderr, "Error publishing: %s\n", emsg);
+ FPRINTF (stderr, "Error publishing: %s\n", emsg);
err = 1;
GNUNET_FS_stop (fs);
return;
GNUNET_CRYPTO_hash_to_enc (&nsid, &enc);
GNUNET_snprintf (sbuf, sizeof (sbuf), "gnunet://fs/sks/%s/this", &enc);
sks_uri = GNUNET_FS_uri_parse (sbuf, &msg);
- if (msg != NULL)
+ if (NULL == sks_uri)
{
- fprintf (stderr, "failed to parse URI `%s': %s\n", sbuf, msg);
+ FPRINTF (stderr, "failed to parse URI `%s': %s\n", sbuf, msg);
err = 1;
GNUNET_FS_stop (fs);
- GNUNET_free (msg);
+ GNUNET_free_non_null (msg);
return;
}
ksk_search =
if (NULL != emsg)
{
- fprintf (stderr, "Error publishing: %s\n", emsg);
+ FPRINTF (stderr, "Error publishing: %s\n", emsg);
err = 1;
GNUNET_FS_stop (fs);
return;
GNUNET_FS_namespace_list (fs, &ns_iterator, &ok);
if (GNUNET_NO == ok)
{
- fprintf (stderr, "namespace_list failed to find namespace!\n");
+ FPRINTF (stderr, "%s", "namespace_list failed to find namespace!\n");
GNUNET_FS_namespace_delete (ns, GNUNET_YES);
GNUNET_FS_stop (fs);
err = 1;
static void
-run (void *cls,
- char *const *args,
- const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
+run (void *cls, char *const *args, const char *cfgfile,
+ const struct GNUNET_CONFIGURATION_Handle *cfg)
{
setup_peer (&p1, "test_fs_namespace_data.conf");
- fs = GNUNET_FS_start (cfg,
- "test-fs-namespace",
- &progress_cb,
- NULL, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
+ fs = GNUNET_FS_start (cfg, "test-fs-namespace", &progress_cb, NULL,
+ GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
testNamespace ();
}
"WARNING",
#endif
NULL);
- GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1,
- argvx, "test-fs-namespace",
- "nohelp", options, &run, NULL);
+ GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
+ "test-fs-namespace", "nohelp", options, &run, NULL);
stop_arm (&p1);
if (GNUNET_YES != update_started)
{
- fprintf (stderr, "Update search never started!\n");
+ FPRINTF (stderr, "%s", "Update search never started!\n");
err = 1;
}
GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-namespace/");