]> granicus.if.org Git - file/commitdiff
Don't exit with -1.
authorChristos Zoulas <christos@zoulas.com>
Thu, 10 Jul 2003 17:01:38 +0000 (17:01 +0000)
committerChristos Zoulas <christos@zoulas.com>
Thu, 10 Jul 2003 17:01:38 +0000 (17:01 +0000)
src/apprentice.c
src/file.c

index c78c5956c65a4d0e563ed0fa90fdb165dd5c0d7e..f7030d75a42be5a94f97ceb179c3aa92cad9b08e 100644 (file)
@@ -50,7 +50,7 @@
 #endif
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: apprentice.c,v 1.59 2003/06/10 18:28:37 christos Exp $")
+FILE_RCSID("@(#)$Id: apprentice.c,v 1.60 2003/07/10 17:01:38 christos Exp $")
 #endif /* lint */
 
 #define        EATAB {while (isascii((unsigned char) *l) && \
@@ -126,7 +126,7 @@ main(int argc, char *argv[])
        }
        magicfile = argv[1];
 
-       exit(apprentice(magicfile, COMPILE, MAGIC_CHECK));
+       exit(file_apprentice(magicfile, COMPILE, MAGIC_CHECK) == -1 ? 1 : 0);
 }
 #endif /* COMPILE_ONLY */
 
index e817f64ee197cfe81bf80f07f9825f5531ad3890..3217669ca65653111b7a0eb69961208496f0c667 100644 (file)
@@ -72,7 +72,7 @@
 #include "patchlevel.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: file.c,v 1.77 2003/03/27 22:46:51 christos Exp $")
+FILE_RCSID("@(#)$Id: file.c,v 1.78 2003/07/10 17:01:38 christos Exp $")
 #endif /* lint */
 
 
@@ -279,8 +279,9 @@ main(int argc, char *argv[])
                            strerror(errno));
                        return 1;
                }
-               return action == FILE_CHECK ? magic_check(magic, magicfile) :
+               c = action == FILE_CHECK ? magic_check(magic, magicfile) :
                    magic_compile(magic, magicfile);
+               return c == -1 ? 1 : 0;
        default:
                load(magicfile, flags);
                break;