From: Christian Grothoff Date: Sun, 5 Feb 2012 08:37:13 +0000 (+0000) Subject: -eliminate printing warning on MAGIC missmatch (#2138) X-Git-Tag: initial-import-from-subversion-38251~14936 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b393537f38727987db955152cc34d69f4fb4173b;p=oweals%2Fgnunet.git -eliminate printing warning on MAGIC missmatch (#2138) --- diff --git a/src/fs/fs_directory.c b/src/fs/fs_directory.c index d5f73623a..b26ec12d3 100644 --- a/src/fs/fs_directory.c +++ b/src/fs/fs_directory.c @@ -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) { diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c index adb071e8d..a853e8899 100644 --- a/src/fs/gnunet-directory.c +++ b/src/fs/gnunet-directory.c @@ -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); }