-eliminate printing warning on MAGIC missmatch (#2138)
authorChristian Grothoff <christian@grothoff.org>
Sun, 5 Feb 2012 08:37:13 +0000 (08:37 +0000)
committerChristian Grothoff <christian@grothoff.org>
Sun, 5 Feb 2012 08:37:13 +0000 (08:37 +0000)
src/fs/fs_directory.c
src/fs/gnunet-directory.c

index d5f73623a04fff21cfc39f0667ece91a9bc6c9eb..b26ec12d3d33aa66013917cf1ba9cb332e315276 100644 (file)
@@ -197,11 +197,7 @@ GNUNET_FS_directory_list_contents (size_t size, const void *data,
   if ((offset == 0) &&
       ((size < 8 + sizeof (uint32_t)) ||
        (0 != memcmp (cdata, GNUNET_FS_DIRECTORY_MAGIC, 8))))
-  {
-    GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
-                _("MAGIC mismatch.  This is not a GNUnet directory.\n"));
     return GNUNET_SYSERR;
-  }
   pos = offset;
   if (offset == 0)
   {
index adb071e8df83c7ee6a1b5cc9d18a07301861c4af..a853e8899ea53c813cb53b5d075c7a51855e9b0c 100644 (file)
@@ -150,8 +150,11 @@ run (void *cls, char *const *args, const char *cfgfile,
     len = (size_t) size;
     data = GNUNET_DISK_file_map (h, &map, GNUNET_DISK_MAP_TYPE_READ, len);
     GNUNET_assert (NULL != data);
-    GNUNET_FS_directory_list_contents (len, data, 0, &print_entry, NULL);
-    printf ("\n");
+    if (GNUNET_OK != GNUNET_FS_directory_list_contents (len, data, 0, &print_entry, NULL))
+      fprintf (stdout, _("`%s' is not a GNUnet directory\n"),
+              filename);
+    else
+      printf ("\n");
     GNUNET_DISK_file_unmap (map);
     GNUNET_DISK_file_close (h);
   }