aboutsummaryrefslogtreecommitdiff
path: root/miscutils/mt.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-10-18 22:28:26 +0000
committerEric Andersen <andersen@codepoet.org>1999-10-18 22:28:26 +0000
commitb0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7 (patch)
treeb951f34000ebdef0491eecd9386e5ea3e535171a /miscutils/mt.c
parent703c62da63aa31d665a8215f373b26e4b54f1bf4 (diff)
downloadbusybox-w32-b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7.tar.gz
busybox-w32-b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7.tar.bz2
busybox-w32-b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7.zip
More stuff.
-Erik
Diffstat (limited to 'miscutils/mt.c')
-rw-r--r--miscutils/mt.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/miscutils/mt.c b/miscutils/mt.c
index 7d75fbd3d..a61ad5a40 100644
--- a/miscutils/mt.c
+++ b/miscutils/mt.c
@@ -50,7 +50,7 @@ static const struct mt_opcodes opcodes[] = {
50}; 50};
51 51
52extern int 52extern int
53mt_main(struct FileInfo * i, int argc, char * * argv) 53mt_main(int argc, char** argv)
54{ 54{
55 const char * file = "/dev/tape"; 55 const char * file = "/dev/tape";
56 const struct mt_opcodes * code = opcodes; 56 const struct mt_opcodes * code = opcodes;
@@ -59,8 +59,7 @@ mt_main(struct FileInfo * i, int argc, char * * argv)
59 59
60 if ( strcmp(argv[1], "-f") == 0 ) { 60 if ( strcmp(argv[1], "-f") == 0 ) {
61 if ( argc < 4 ) { 61 if ( argc < 4 ) {
62 usage(mt_usage); 62 usage (mt_usage);
63 return 1;
64 } 63 }
65 file = argv[2]; 64 file = argv[2];
66 argv += 2; 65 argv += 2;
@@ -75,7 +74,7 @@ mt_main(struct FileInfo * i, int argc, char * * argv)
75 74
76 if ( code->name == 0 ) { 75 if ( code->name == 0 ) {
77 fprintf(stderr, "mt: unrecognized opcode %s.\n", argv[1]); 76 fprintf(stderr, "mt: unrecognized opcode %s.\n", argv[1]);
78 return 1; 77 return( FALSE);
79 } 78 }
80 79
81 op.mt_op = code->value; 80 op.mt_op = code->value;
@@ -85,14 +84,14 @@ mt_main(struct FileInfo * i, int argc, char * * argv)
85 op.mt_count = 1; /* One, not zero, right? */ 84 op.mt_count = 1; /* One, not zero, right? */
86 85
87 if ( (fd = open(file, O_RDONLY, 0)) < 0 ) { 86 if ( (fd = open(file, O_RDONLY, 0)) < 0 ) {
88 name_and_error(file); 87 perror(file);
89 return 1; 88 return( FALSE);
90 } 89 }
91 90
92 if ( ioctl(fd, MTIOCTOP, &op) != 0 ) { 91 if ( ioctl(fd, MTIOCTOP, &op) != 0 ) {
93 name_and_error(file); 92 perror(file);
94 return 1; 93 return( FALSE);
95 } 94 }
96 95
97 return 0; 96 return( TRUE);
98} 97}