arg
[oweals/gnunet.git] / src / fs / test_fs_download_recursive.c
index 1c8df5d0da96805fbbd31ab620839c7aae8b8fae..d24a38dbcae1070e02e0f647d3d8882558ce0065 100644 (file)
@@ -39,7 +39,7 @@
 
 static struct GNUNET_GE_Context *ectx;
 
-volatile int download_done;
+static int download_done;
 
 static char *
 makeName (unsigned int i)
@@ -150,8 +150,8 @@ checkHierarchy (unsigned int i, const char *tree)
 }
 
 
-static volatile enum GNUNET_FSUI_EventType lastEvent;
-static volatile enum GNUNET_FSUI_EventType waitForEvent;
+static enum GNUNET_FSUI_EventType lastEvent;
+static enum GNUNET_FSUI_EventType waitForEvent;
 static struct GNUNET_FSUI_Context *ctx;
 static struct GNUNET_ECRS_URI *upURI;
 static struct GNUNET_FSUI_DownloadList *download;
@@ -256,7 +256,7 @@ int
 main (int argc, char *argv[])
 {
 #if START_DAEMON
-  pid_t daemon;
+  struct GNUNET_OS_Process *daemon;
 #endif
   int ok;
   char *fn = NULL;
@@ -284,7 +284,7 @@ main (int argc, char *argv[])
   GNUNET_disk_directory_remove (NULL,
                                 "/tmp/gnunet-fsui-recursive_download_test/");
   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));
@@ -372,6 +372,8 @@ FAILURE:
 
 #if START_DAEMON
   GNUNET_GE_BREAK (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;