From: Christian Grothoff Date: Fri, 18 Jun 2010 14:47:03 +0000 (+0000) Subject: code clean up X-Git-Tag: initial-import-from-subversion-38251~21337 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2be168f3924a38f2d4f9071ccf53e6a032e9087d;p=oweals%2Fgnunet.git code clean up --- diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index 4e6d6f965..c055a6208 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c @@ -235,10 +235,13 @@ run (void *cls, cfg = c; config_file = cfgfile; if (GNUNET_CONFIGURATION_get_value_string(cfg, "PATHS", "SERVICEHOME", &dir) != GNUNET_OK) - { - dir = NULL; - } - + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + _("Fatal configuration error: `%s' option in section `%s' missing.\n"), + "SERVICEHOME", + "PATHS"); + return; + } h = GNUNET_ARM_connect (cfg, sched, NULL); if (h == NULL) { diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index 18c4fd78e..c8c486bd7 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -395,6 +395,12 @@ run (void *cls, sched = s; /* check arguments */ + if ((uri_string != NULL) && (extract_only)) + { + printf (_("Cannot extract metadata from a URI!\n")); + ret = -1; + return; + } if ( ( (uri_string == NULL) || (extract_only) ) && ( (args[0] == NULL) || (args[1] != NULL) ) ) { @@ -409,12 +415,6 @@ run (void *cls, ret = -1; return; } - if ((uri_string != NULL) && (extract_only)) - { - printf (_("Cannot extract metadata from a URI!\n")); - ret = -1; - return; - } if (pseudonym != NULL) { if (NULL == this_id) @@ -445,14 +445,6 @@ run (void *cls, return; } } - if ( (args[0] == NULL) && - (uri_string == NULL) ) - { - fprintf (stderr, - _("Need the name of a file to publish!\n")); - ret = 1; - return; - } cfg = c; ctx = GNUNET_FS_start (sched, cfg, diff --git a/src/util/connection.c b/src/util/connection.c index acbeca4ed..1f2624a28 100644 --- a/src/util/connection.c +++ b/src/util/connection.c @@ -529,11 +529,6 @@ destroy_continuation (void *cls, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Destroy actually runs (%p)!\n", sock); #endif - if (sock->dns_active != NULL) - { - GNUNET_RESOLVER_request_cancel (sock->dns_active); - sock->dns_active = NULL; - } while (NULL != (pos = sock->ap_head)) { GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (pos->sock)); diff --git a/src/util/os_priority.c b/src/util/os_priority.c index a9f79fe96..bc4b66b55 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c @@ -61,7 +61,7 @@ int GNUNET_OS_set_process_priority (pid_t proc, enum GNUNET_SCHEDULER_Priority prio) { - int rprio = 0; + int rprio; GNUNET_assert (prio < GNUNET_SCHEDULER_PRIORITY_COUNT); if (prio == GNUNET_SCHEDULER_PRIORITY_KEEP)