-use GPLv3+ consistently
[oweals/gnunet.git] / src / fs / fs_dirmetascan.c
index 0afec3886c18324ea72fc9e19ffe5f03cc187029..b26ef1ce0fd95d98fedeb45d2c26c40a9e8ebd0b 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -102,7 +102,7 @@ GNUNET_FS_directory_scan_abort (struct GNUNET_FS_DirScanner *ds)
 {
   /* terminate helper */
   if (NULL != ds->helper)
-    GNUNET_HELPER_stop (ds->helper);
+    GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
   
   /* free resources */
   if (NULL != ds->toplevel)
@@ -232,8 +232,11 @@ finish_scan (void *cls,
   struct GNUNET_FS_DirScanner *ds = cls;
 
   ds->stop_task = GNUNET_SCHEDULER_NO_TASK;
-  GNUNET_HELPER_stop (ds->helper);
-  ds->helper = NULL;
+  if (NULL != ds->helper)
+  {
+    GNUNET_HELPER_stop (ds->helper, GNUNET_NO);
+    ds->helper = NULL;
+  }
   ds->progress_callback (ds->progress_callback_cls, 
                         NULL, GNUNET_SYSERR,
                         GNUNET_FS_DIRSCANNER_FINISHED);    
@@ -425,6 +428,8 @@ helper_died_cb (void *cls)
   struct GNUNET_FS_DirScanner *ds = cls;
 
   ds->helper = NULL;
+  if (GNUNET_SCHEDULER_NO_TASK != ds->stop_task)
+    return; /* normal death, was finished */
   ds->progress_callback (ds->progress_callback_cls, 
                         NULL, GNUNET_SYSERR,
                         GNUNET_FS_DIRSCANNER_INTERNAL_ERROR);