summaryrefslogtreecommitdiff
path: root/miscutils
diff options
context:
space:
mode:
authorEric Andersen1999-10-18 22:28:26 +0000
committerEric Andersen1999-10-18 22:28:26 +0000
commitb0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7 (patch)
treeb951f34000ebdef0491eecd9386e5ea3e535171a /miscutils
parent703c62da63aa31d665a8215f373b26e4b54f1bf4 (diff)
downloadbusybox-b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7.zip
busybox-b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7.tar.gz
More stuff.
-Erik
Diffstat (limited to 'miscutils')
-rw-r--r--miscutils/dutmp.c3
-rw-r--r--miscutils/makedevs.c4
-rw-r--r--miscutils/mt.c17
3 files changed, 11 insertions, 13 deletions
diff --git a/miscutils/dutmp.c b/miscutils/dutmp.c
index 2dad7d4..7dd5b91 100644
--- a/miscutils/dutmp.c
+++ b/miscutils/dutmp.c
@@ -26,8 +26,7 @@ extern int dutmp_fn (int argc, char **argv)
struct utmp ut;
if ((argc < 2) || (**(argv + 1) == '-')) {
- fprintf (stderr, "Usage: %s %s\n", *argv, dutmp_usage);
- exit (FALSE);
+ usage( dutmp_usage);
}
if ( **(++argv) == 0 ) {
diff --git a/miscutils/makedevs.c b/miscutils/makedevs.c
index 691236e..00f0066 100644
--- a/miscutils/makedevs.c
+++ b/miscutils/makedevs.c
@@ -21,7 +21,7 @@ const char makedevs_usage[] =
"\tmakedevs /dev/hda b 3 0 0 8 s (hda,hda1-hda8)\n";
int
-makedevs_main(struct FileInfo * i, int argc, char * * argv)
+makedevs_main(int argc, char * * argv)
{
const char *basedev = argv[1];
@@ -45,7 +45,7 @@ char buf[255];
case 'f':
mode = S_IFIFO; break;
default:
- usage(makedevs_usage);
+ fprintf(stderr, "Usage: %s\n", makedevs_usage);
return 2;
}
mode |= 0660;
diff --git a/miscutils/mt.c b/miscutils/mt.c
index 7d75fbd..a61ad5a 100644
--- a/miscutils/mt.c
+++ b/miscutils/mt.c
@@ -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);
}