Making note of my changes
[oweals/busybox.git] / mt.c
diff --git a/mt.c b/mt.c
index 7d75fbd3d50d9a298b0937cf07c6149a23735370..7168ef7ac79a07c160518c0848751fb225734ca3 100644 (file)
--- a/mt.c
+++ b/mt.c
@@ -3,7 +3,7 @@
 #include <sys/mtio.h>
 #include <sys/fcntl.h>
 
-const char     mt_usage[] = "mt [-f device] opcode value\n";
+static const char      mt_usage[] = "mt [-f device] opcode value\n";
 
 struct mt_opcodes {
        char *  name;
@@ -50,7 +50,7 @@ static const struct mt_opcodes        opcodes[] = {
 };
 
 extern int
-mt_main(struct FileInfo * i, int argc, char * * argv)
+mt_main(int argc, char** argv)
 {
        const char *                            file = "/dev/tape";
        const struct mt_opcodes *       code = opcodes;
@@ -59,8 +59,7 @@ mt_main(struct FileInfo * i, int argc, char * * argv)
        
        if ( strcmp(argv[1], "-f") == 0 ) {
                if ( argc < 4 ) {
-                       usage(mt_usage);
-                       return 1;
+                   usage (mt_usage);
                }
                file = argv[2];
                argv += 2;
@@ -75,7 +74,7 @@ mt_main(struct FileInfo * i, int argc, char * * argv)
 
        if ( code->name == 0 ) {
                fprintf(stderr, "mt: unrecognized opcode %s.\n", argv[1]);
-               return 1;
+               return( FALSE);
        }
 
        op.mt_op = code->value;
@@ -85,14 +84,14 @@ mt_main(struct FileInfo * i, int argc, char * * argv)
                op.mt_count = 1; /* One, not zero, right? */
 
        if ( (fd = open(file, O_RDONLY, 0)) < 0 ) {
-               name_and_error(file);
-               return 1;
+               perror(file);
+               return( FALSE);
        }
 
        if ( ioctl(fd, MTIOCTOP, &op) != 0 ) {
-               name_and_error(file);
-               return 1;
+               perror(file);
+               return( FALSE);
        }
 
-       return 0;
+       return( TRUE);
 }