Add errno.h
[oweals/busybox.git] / mt.c
diff --git a/mt.c b/mt.c
index 6acae4ea1f846bcffd11f92cec56fc2c2a54e149..70d03cca40177f3f02d9ca29d26faab33423f8f0 100644 (file)
--- a/mt.c
+++ b/mt.c
@@ -75,8 +75,8 @@ extern int mt_main(int argc, char **argv)
        }
 
        if (code->name == 0) {
-               errorMsg("unrecognized opcode %s.\n", argv[1]);
-               exit (FALSE);
+               error_msg("unrecognized opcode %s.\n", argv[1]);
+               return EXIT_FAILURE;
        }
 
        op.mt_op = code->value;
@@ -85,15 +85,11 @@ extern int mt_main(int argc, char **argv)
        else
                op.mt_count = 1;                /* One, not zero, right? */
 
-       if ((fd = open(file, O_RDONLY, 0)) < 0) {
-               perror(file);
-               exit (FALSE);
-       }
+       if ((fd = open(file, O_RDONLY, 0)) < 0)
+               perror_msg_and_die("%s", file);
 
-       if (ioctl(fd, MTIOCTOP, &op) != 0) {
-               perror(file);
-               exit (FALSE);
-       }
+       if (ioctl(fd, MTIOCTOP, &op) != 0)
+               perror_msg_and_die("%s", file);
 
-       return (TRUE);
+       return EXIT_SUCCESS;
 }