fixing block reconstruction start/shutdown code
[oweals/gnunet.git] / src / fs / test_fs_search_ranking.c
index 13ef926204487df004d26bdfbf1ec2dd0c3c2e89..06c37dfc25b0550c029216942e1ce3ea4c11b52f 100644 (file)
@@ -48,15 +48,15 @@ makeName (unsigned int i)
 
 static struct GNUNET_FSUI_SearchList *search;
 
-static volatile enum GNUNET_FSUI_EventType lastEvent;
+static enum GNUNET_FSUI_EventType lastEvent;
 
-static volatile struct GNUNET_ECRS_URI *uri;
+static struct GNUNET_ECRS_URI *uri;
 
-static volatile int availability;
+static int availability;
 
-static volatile unsigned int rank;
+static unsigned int rank;
 
-static volatile enum GNUNET_FSUI_EventType waitForEvent;
+static enum GNUNET_FSUI_EventType waitForEvent;
 
 static void *
 eventCallback (void *cls, const GNUNET_FSUI_Event * event)
@@ -126,7 +126,7 @@ int
 main (int argc, char *argv[])
 {
 #if START_DAEMON
-  pid_t daemon;
+  struct GNUNET_OS_Process *daemon;
 #endif
   int ok;
   char *fn = NULL;
@@ -153,7 +153,7 @@ main (int argc, char *argv[])
 #if START_DAEMON
   GNUNET_disk_directory_remove (NULL, "/tmp/gnunet-fsui-searchranktest/");
   daemon = GNUNET_daemon_start (NULL, cfg, "peer.conf", GNUNET_NO);
-  GNUNET_GE_ASSERT (NULL, daemon > 0);
+  GNUNET_GE_ASSERT (NULL, daemon != NULL);
   CHECK (GNUNET_OK ==
          GNUNET_wait_for_daemon_running (NULL, cfg,
                                          30 * GNUNET_CRON_SECONDS));
@@ -242,6 +242,8 @@ FAILURE:
 
 #if START_DAEMON
   GNUNET_GE_ASSERT (NULL, GNUNET_OK == GNUNET_daemon_stop (NULL, daemon));
+  GNUNET_OS_process_close (daemon);
+  daemon = NULL;
 #endif
   GNUNET_GC_free (cfg);
   return (ok == GNUNET_YES) ? 0 : 1;