summaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorEric Andersen1999-10-18 22:28:26 +0000
committerEric Andersen1999-10-18 22:28:26 +0000
commitb0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7 (patch)
treeb951f34000ebdef0491eecd9386e5ea3e535171a /util-linux
parent703c62da63aa31d665a8215f373b26e4b54f1bf4 (diff)
downloadbusybox-b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7.zip
busybox-b0e9a709ba1ae1724d413a77f5b67b1a3e6c6cb7.tar.gz
More stuff.
-Erik
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/dmesg.c2
-rw-r--r--util-linux/fdflush.c3
-rw-r--r--util-linux/mkswap.c17
-rw-r--r--util-linux/more.c3
-rw-r--r--util-linux/swaponoff.c10
-rw-r--r--util-linux/umount.c6
6 files changed, 18 insertions, 23 deletions
diff --git a/util-linux/dmesg.c b/util-linux/dmesg.c
index 64265b4..e5d403f 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -93,6 +93,6 @@ int dmesg_main (int argc, char **argv)
exit (TRUE);
end:
- fprintf (stderr, "Usage: %s\n", dmesg_usage);
+ usage( dmesg_usage);
exit (FALSE);
}
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index ce6870c..58b8b37 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -32,8 +32,7 @@ extern int fdflush_main(int argc, char **argv)
int value;
int fd;
if ( **(argv+1) == '-' ) {
- fprintf(stderr, "Usage: fdflush device\n");
- exit(FALSE);
+ usage( "fdflush device\n");
}
fd = open(*argv, 0);
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index f797d13..8c0c4de 100644
--- a/util-linux/mkswap.c
+++ b/util-linux/mkswap.c
@@ -83,7 +83,7 @@ static int bit_test_and_clear (unsigned int *addr, unsigned int nr)
volatile void fatal_error(const char * fmt_string)
{
fprintf(stderr,fmt_string,program_name,device_name);
- exit(1);
+ exit(FALSE);
}
#define die(str) fatal_error("%s: " str "\n")
@@ -170,7 +170,7 @@ static int get_size(const char *file)
}
int
-mkswap(char *device_name, int pages, int check)
+mkswap(const char *device_name, int pages, int check)
{
struct stat statbuf;
int goodpages;
@@ -219,10 +219,10 @@ mkswap(char *device_name, int pages, int check)
die("unable to write signature page");
close(DEV);
- return 0;
+ return (TRUE);
}
-int mkswap_main(struct FileInfo * unnecessary, int argc, char ** argv)
+int mkswap_main(int argc, char ** argv)
{
char * tmp;
long int pages=0;
@@ -237,17 +237,16 @@ int mkswap_main(struct FileInfo * unnecessary, int argc, char ** argv)
if (device_name) {
pages = strtol(argv[0],&tmp,0)>>(PAGE_SHIFT-10);
if (*tmp) {
- usage(mkswap_usage);
- exit(1);
+ usage (mkswap_usage);
}
} else
device_name = argv[0];
else while (*++argv[0])
switch (argv[0][0]) {
case 'c': check=1; break;
- default: usage(mkswap_usage);
- exit(1);
+ default: usage (mkswap_usage);
+ exit( TRUE);
}
}
- return mkswap(device_name, pages, check);
+ exit( mkswap(device_name, pages, check));
}
diff --git a/util-linux/more.c b/util-linux/more.c
index a56ce97..53437ed 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -59,8 +59,7 @@ extern int more_main(int argc, char **argv)
FILE *file = stdin;
if ( strcmp(*argv,"--help")==0 || strcmp(*argv,"-h")==0 ) {
- fprintf(stderr, "Usage: %s %s", *argv, more_usage);
- exit(FALSE);
+ usage (more_usage);
}
argc--;
argv++;
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 56f93b3..5a2d735 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -33,10 +33,10 @@ static int whichApp;
static const char* appName;
static const char swapoff_usage[] =
-"Usage: swapoff device\n"
+"swapoff device\n"
"\nStop swapping virtual memory pages on the given device.\n";
static const char swapon_usage[] =
-"Usage: swapon device\n"
+"swapon device\n"
"\nStart swapping virtual memory pages on the given device.\n";
@@ -112,10 +112,10 @@ swap_on_off_main(int argc, char * * argv)
}
}
swap_enable_disable(*argv);
- //exit( TRUE);
+ exit( TRUE);
usage_and_exit:
- fprintf(stderr, "Usage: %s", (whichApp==SWAPON_APP)? swapon_usage : swapoff_usage);
- exit(FALSE);
+ usage( (whichApp==SWAPON_APP)? swapon_usage : swapoff_usage);
+ exit( FALSE);
}
diff --git a/util-linux/umount.c b/util-linux/umount.c
index a83a508..625fcfa 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -71,8 +71,7 @@ umount_main(int argc, char * * argv)
{
if (argc < 2) {
- fprintf(stderr, "Usage: %s", umount_usage);
- exit(FALSE);
+ usage( umount_usage);
}
argc--;
argv++;
@@ -84,8 +83,7 @@ umount_main(int argc, char * * argv)
exit ( umount_all() );
break;
default:
- fprintf(stderr, "Usage: %s\n", umount_usage);
- exit( FALSE);
+ usage( umount_usage);
}
}
if ( umount(*argv) == 0 )