-check return value
authorChristian Grothoff <christian@grothoff.org>
Mon, 7 May 2012 07:59:00 +0000 (07:59 +0000)
committerChristian Grothoff <christian@grothoff.org>
Mon, 7 May 2012 07:59:00 +0000 (07:59 +0000)
src/statistics/gnunet-statistics.c

index 85d8b8c4da9310984b793da9f4f210024fe7bc95..c2851414445c9240265463ff7dc1dd42ed474a82 100644 (file)
@@ -184,7 +184,12 @@ run (void *cls, char *const *args, const char *cfgfile,
       ret = 1;
       return;
     }
-    GNUNET_STATISTICS_watch(h, subsystem, name, &printer, h);
+    if (GNUNET_OK != GNUNET_STATISTICS_watch (h, subsystem, name, &printer, h))
+    {
+      fprintf (stderr, _("Failed to initialize watch routine\n"));
+      GNUNET_SCHEDULER_add_now (&shutdown_task, h);
+      return;
+    }
     GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, h);
   }
 }