Moved some code and add a coupld #defines to support use of dmalloc.
[oweals/busybox.git] / mt.c
diff --git a/mt.c b/mt.c
index cf20d1711bbf11d695cc31bfeadaf4cc66b81d1e..087819e72af6f0e859151e17b146cb80fbaa5d30 100644 (file)
--- a/mt.c
+++ b/mt.c
@@ -4,9 +4,6 @@
 #include <sys/mtio.h>
 #include <sys/fcntl.h>
 
-static const char mt_usage[] = "mt [-f device] opcode value\n\n"
-                       "Control magnetic tape drive operation\n";
-
 struct mt_opcodes {
        char *name;
        short value;
@@ -58,7 +55,7 @@ extern int mt_main(int argc, char **argv)
        struct mtop op;
        int fd;
        
-       if ((argc != 2 && argc != 3) || **(argv + 1) == '-') {
+       if ((argc != 2 && argc != 3) && **(argv + 1) != '-') {
                usage(mt_usage);
        }
 
@@ -78,7 +75,7 @@ extern int mt_main(int argc, char **argv)
        }
 
        if (code->name == 0) {
-               fprintf(stderr, "mt: unrecognized opcode %s.\n", argv[1]);
+               errorMsg("unrecognized opcode %s.\n", argv[1]);
                exit (FALSE);
        }
 
@@ -98,5 +95,5 @@ extern int mt_main(int argc, char **argv)
                exit (FALSE);
        }
 
-       exit (TRUE);
+       return (TRUE);
 }