aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-18 22:28:26 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>1999-10-18 22:28:26 +0000
commit0d2bfbda7eff5105f000a216789b68fed8fae031 (patch)
treeb951f34000ebdef0491eecd9386e5ea3e535171a /util-linux
parentb45ce89974024bd2dbb2f0d5ec0a8d42cc79d030 (diff)
downloadbusybox-w32-0d2bfbda7eff5105f000a216789b68fed8fae031.tar.gz
busybox-w32-0d2bfbda7eff5105f000a216789b68fed8fae031.tar.bz2
busybox-w32-0d2bfbda7eff5105f000a216789b68fed8fae031.zip
More stuff.
-Erik git-svn-id: svn://busybox.net/trunk/busybox@34 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 64265b473..e5d403f7a 100644
--- a/util-linux/dmesg.c
+++ b/util-linux/dmesg.c
@@ -93,6 +93,6 @@ int dmesg_main (int argc, char **argv)
93 exit (TRUE); 93 exit (TRUE);
94 94
95 end: 95 end:
96 fprintf (stderr, "Usage: %s\n", dmesg_usage); 96 usage( dmesg_usage);
97 exit (FALSE); 97 exit (FALSE);
98} 98}
diff --git a/util-linux/fdflush.c b/util-linux/fdflush.c
index ce6870cd1..58b8b37d6 100644
--- a/util-linux/fdflush.c
+++ b/util-linux/fdflush.c
@@ -32,8 +32,7 @@ extern int fdflush_main(int argc, char **argv)
32 int value; 32 int value;
33 int fd; 33 int fd;
34 if ( **(argv+1) == '-' ) { 34 if ( **(argv+1) == '-' ) {
35 fprintf(stderr, "Usage: fdflush device\n"); 35 usage( "fdflush device\n");
36 exit(FALSE);
37 } 36 }
38 37
39 fd = open(*argv, 0); 38 fd = open(*argv, 0);
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c
index f797d1395..8c0c4dec7 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)
83volatile void fatal_error(const char * fmt_string) 83volatile void fatal_error(const char * fmt_string)
84{ 84{
85 fprintf(stderr,fmt_string,program_name,device_name); 85 fprintf(stderr,fmt_string,program_name,device_name);
86 exit(1); 86 exit(FALSE);
87} 87}
88 88
89#define die(str) fatal_error("%s: " str "\n") 89#define die(str) fatal_error("%s: " str "\n")
@@ -170,7 +170,7 @@ static int get_size(const char *file)
170} 170}
171 171
172int 172int
173mkswap(char *device_name, int pages, int check) 173mkswap(const char *device_name, int pages, int check)
174 { 174 {
175 struct stat statbuf; 175 struct stat statbuf;
176 int goodpages; 176 int goodpages;
@@ -219,10 +219,10 @@ mkswap(char *device_name, int pages, int check)
219 die("unable to write signature page"); 219 die("unable to write signature page");
220 220
221 close(DEV); 221 close(DEV);
222 return 0; 222 return (TRUE);
223} 223}
224 224
225int mkswap_main(struct FileInfo * unnecessary, int argc, char ** argv) 225int mkswap_main(int argc, char ** argv)
226{ 226{
227 char * tmp; 227 char * tmp;
228 long int pages=0; 228 long int pages=0;
@@ -237,17 +237,16 @@ int mkswap_main(struct FileInfo * unnecessary, int argc, char ** argv)
237 if (device_name) { 237 if (device_name) {
238 pages = strtol(argv[0],&tmp,0)>>(PAGE_SHIFT-10); 238 pages = strtol(argv[0],&tmp,0)>>(PAGE_SHIFT-10);
239 if (*tmp) { 239 if (*tmp) {
240 usage(mkswap_usage); 240 usage (mkswap_usage);
241 exit(1);
242 } 241 }
243 } else 242 } else
244 device_name = argv[0]; 243 device_name = argv[0];
245 else while (*++argv[0]) 244 else while (*++argv[0])
246 switch (argv[0][0]) { 245 switch (argv[0][0]) {
247 case 'c': check=1; break; 246 case 'c': check=1; break;
248 default: usage(mkswap_usage); 247 default: usage (mkswap_usage);
249 exit(1); 248 exit( TRUE);
250 } 249 }
251 } 250 }
252 return mkswap(device_name, pages, check); 251 exit( mkswap(device_name, pages, check));
253} 252}
diff --git a/util-linux/more.c b/util-linux/more.c
index a56ce97d7..53437ed58 100644
--- a/util-linux/more.c
+++ b/util-linux/more.c
@@ -59,8 +59,7 @@ extern int more_main(int argc, char **argv)
59 FILE *file = stdin; 59 FILE *file = stdin;
60 60
61 if ( strcmp(*argv,"--help")==0 || strcmp(*argv,"-h")==0 ) { 61 if ( strcmp(*argv,"--help")==0 || strcmp(*argv,"-h")==0 ) {
62 fprintf(stderr, "Usage: %s %s", *argv, more_usage); 62 usage (more_usage);
63 exit(FALSE);
64 } 63 }
65 argc--; 64 argc--;
66 argv++; 65 argv++;
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 56f93b393..5a2d735ad 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -33,10 +33,10 @@ static int whichApp;
33static const char* appName; 33static const char* appName;
34 34
35static const char swapoff_usage[] = 35static const char swapoff_usage[] =
36"Usage: swapoff device\n" 36"swapoff device\n"
37"\nStop swapping virtual memory pages on the given device.\n"; 37"\nStop swapping virtual memory pages on the given device.\n";
38static const char swapon_usage[] = 38static const char swapon_usage[] =
39"Usage: swapon device\n" 39"swapon device\n"
40"\nStart swapping virtual memory pages on the given device.\n"; 40"\nStart swapping virtual memory pages on the given device.\n";
41 41
42 42
@@ -112,10 +112,10 @@ swap_on_off_main(int argc, char * * argv)
112 } 112 }
113 } 113 }
114 swap_enable_disable(*argv); 114 swap_enable_disable(*argv);
115 //exit( TRUE); 115 exit( TRUE);
116 116
117usage_and_exit: 117usage_and_exit:
118 fprintf(stderr, "Usage: %s", (whichApp==SWAPON_APP)? swapon_usage : swapoff_usage); 118 usage( (whichApp==SWAPON_APP)? swapon_usage : swapoff_usage);
119 exit(FALSE); 119 exit( FALSE);
120} 120}
121 121
diff --git a/util-linux/umount.c b/util-linux/umount.c
index a83a508f7..625fcfab9 100644
--- a/util-linux/umount.c
+++ b/util-linux/umount.c
@@ -71,8 +71,7 @@ umount_main(int argc, char * * argv)
71{ 71{
72 72
73 if (argc < 2) { 73 if (argc < 2) {
74 fprintf(stderr, "Usage: %s", umount_usage); 74 usage( umount_usage);
75 exit(FALSE);
76 } 75 }
77 argc--; 76 argc--;
78 argv++; 77 argv++;
@@ -84,8 +83,7 @@ umount_main(int argc, char * * argv)
84 exit ( umount_all() ); 83 exit ( umount_all() );
85 break; 84 break;
86 default: 85 default:
87 fprintf(stderr, "Usage: %s\n", umount_usage); 86 usage( umount_usage);
88 exit( FALSE);
89 } 87 }
90 } 88 }
91 if ( umount(*argv) == 0 ) 89 if ( umount(*argv) == 0 )