code clean up
authorChristian Grothoff <christian@grothoff.org>
Fri, 18 Jun 2010 14:47:03 +0000 (14:47 +0000)
committerChristian Grothoff <christian@grothoff.org>
Fri, 18 Jun 2010 14:47:03 +0000 (14:47 +0000)
src/arm/gnunet-arm.c
src/fs/gnunet-publish.c
src/util/connection.c
src/util/os_priority.c

index 4e6d6f9651ac9ddc55045532691e1a30afffad77..c055a6208fe4a428f5703156326e14797523244c 100644 (file)
@@ -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)
     {
index 18c4fd78e3c7eb2b36bbb13d97ae9dd9280aeea1..c8c486bd74fad8d8e44054504fc1410bf7eeb5bc 100644 (file)
@@ -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,
index acbeca4ed0d79e3409dd26d12aeefb1c6b089484..1f2624a283690fd3c8e37151bf2fdf6f0a69280b 100644 (file)
@@ -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));
index a9f79fe96b4a8938745c03776228689391c3da5e..bc4b66b55e227d31e66dcf12c2a2d9fee3267cc9 100644 (file)
@@ -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)