]> granicus.if.org Git - file/commitdiff
when treating block and char files as regular, pretend we did not find
authorChristos Zoulas <christos@zoulas.com>
Sun, 17 Mar 2013 15:43:20 +0000 (15:43 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sun, 17 Mar 2013 15:43:20 +0000 (15:43 +0000)
anything in fsmagic.

src/fsmagic.c

index dcaf389eeec8b519359870f9508b7ffe0888562b..6562d36e4b58b1698298d724a431562cb135d451 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.65 2012/08/26 09:56:26 christos Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.66 2013/01/11 19:46:55 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -169,8 +169,10 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
                 * like ordinary files.  Otherwise, just report that they
                 * are block special files and go on to the next file.
                 */
-               if ((ms->flags & MAGIC_DEVICES) != 0)
+               if ((ms->flags & MAGIC_DEVICES) != 0) {
+                       ret = 0;
                        break;
+               }
                if (mime) {
                        if (handle_mime(ms, mime, "chardevice") == -1)
                                return -1;
@@ -201,8 +203,10 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb)
                 * like ordinary files.  Otherwise, just report that they
                 * are block special files and go on to the next file.
                 */
-               if ((ms->flags & MAGIC_DEVICES) != 0)
+               if ((ms->flags & MAGIC_DEVICES) != 0) {
+                       ret = 0;
                        break;
+               }
                if (mime) {
                        if (handle_mime(ms, mime, "blockdevice") == -1)
                                return -1;