Bump to version 1.22.1
[platform/upstream/busybox.git] / miscutils / mt.c
index c56a8e0..20afd3a 100644 (file)
@@ -1,8 +1,20 @@
 /* vi: set sw=4 ts=4: */
 /*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
+//usage:#define mt_trivial_usage
+//usage:       "[-f device] opcode value"
+//usage:#define mt_full_usage "\n\n"
+//usage:       "Control magnetic tape drive operation\n"
+//usage:       "\n"
+//usage:       "Available Opcodes:\n"
+//usage:       "\n"
+//usage:       "bsf bsfm bsr bss datacompression drvbuffer eof eom erase\n"
+//usage:       "fsf fsfm fsr fss load lock mkpart nop offline ras1 ras2\n"
+//usage:       "ras3 reset retension rewind rewoffline seek setblk setdensity\n"
+//usage:       "setpart tell unload unlock weof wset"
+
 #include "libbb.h"
 #include <sys/mtio.h>
 
@@ -81,7 +93,7 @@ static const char opcode_name[] ALIGN1 =
        "weof"            "\0";
 
 int mt_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
-int mt_main(int argc ATTRIBUTE_UNUSED, char **argv)
+int mt_main(int argc UNUSED_PARAM, char **argv)
 {
        const char *file = "/dev/tape";
        struct mtop op;
@@ -106,9 +118,9 @@ int mt_main(int argc ATTRIBUTE_UNUSED, char **argv)
 
        op.mt_op = opcode_value[idx];
        if (argv[2])
-               op.mt_count = xatoi_u(argv[2]);
+               op.mt_count = xatoi_positive(argv[2]);
        else
-               op.mt_count = 1;                /* One, not zero, right? */
+               op.mt_count = 1;  /* One, not zero, right? */
 
        switch (opcode_value[idx]) {
                case MTWEOF: