diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-07-12 15:38:49 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-07-12 15:38:49 +0000 |
commit | 7b40def2e7abcaa81d71d4bc7717d184c329eb2d (patch) | |
tree | 46d579ac4ec39719ba3b8d18bbc1c359cc9939c5 /util-linux | |
parent | c6d230cee51799861dbc5e917a5919f33c6e5933 (diff) | |
download | busybox-w32-7b40def2e7abcaa81d71d4bc7717d184c329eb2d.tar.gz busybox-w32-7b40def2e7abcaa81d71d4bc7717d184c329eb2d.tar.bz2 busybox-w32-7b40def2e7abcaa81d71d4bc7717d184c329eb2d.zip |
Use global applet_name instead of local versions.
git-svn-id: svn://busybox.net/trunk/busybox@830 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/fsck_minix.c | 9 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 9 | ||||
-rw-r--r-- | util-linux/mkswap.c | 18 | ||||
-rw-r--r-- | util-linux/swaponoff.c | 8 |
4 files changed, 15 insertions, 29 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 9533f40db..685e0ee6c 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -219,7 +219,6 @@ struct minix_dir_entry { | |||
219 | 219 | ||
220 | #define BITS_PER_BLOCK (BLOCK_SIZE<<3) | 220 | #define BITS_PER_BLOCK (BLOCK_SIZE<<3) |
221 | 221 | ||
222 | static char *program_name = "fsck.minix"; | ||
223 | static char *program_version = "1.2 - 11/11/96"; | 222 | static char *program_version = "1.2 - 11/11/96"; |
224 | static char *device_name = NULL; | 223 | static char *device_name = NULL; |
225 | static int IN; | 224 | static int IN; |
@@ -293,7 +292,7 @@ static void show_usage(void) | |||
293 | { | 292 | { |
294 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", | 293 | fprintf(stderr, "BusyBox v%s (%s) multi-call binary -- GPL2\n\n", |
295 | BB_VER, BB_BT); | 294 | BB_VER, BB_BT); |
296 | fprintf(stderr, "Usage: %s [-larvsmf] /dev/name\n", program_name); | 295 | fprintf(stderr, "Usage: %s [-larvsmf] /dev/name\n", applet_name); |
297 | #ifndef BB_FEATURE_TRIVIAL_HELP | 296 | #ifndef BB_FEATURE_TRIVIAL_HELP |
298 | fprintf(stderr, | 297 | fprintf(stderr, |
299 | "\nPerforms a consistency check for MINIX filesystems.\n\n"); | 298 | "\nPerforms a consistency check for MINIX filesystems.\n\n"); |
@@ -312,7 +311,7 @@ static void show_usage(void) | |||
312 | 311 | ||
313 | static void die(const char *str) | 312 | static void die(const char *str) |
314 | { | 313 | { |
315 | fprintf(stderr, "%s: %s\n", program_name, str); | 314 | fprintf(stderr, "%s: %s\n", applet_name, str); |
316 | leave(8); | 315 | leave(8); |
317 | } | 316 | } |
318 | 317 | ||
@@ -1367,8 +1366,6 @@ extern int fsck_minix_main(int argc, char **argv) | |||
1367 | * that automagically, so we can save a few bytes */ | 1366 | * that automagically, so we can save a few bytes */ |
1368 | //atexit(free_name_list); | 1367 | //atexit(free_name_list); |
1369 | 1368 | ||
1370 | if (argc && *argv) | ||
1371 | program_name = *argv; | ||
1372 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) | 1369 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) |
1373 | die("bad inode size"); | 1370 | die("bad inode size"); |
1374 | #ifdef HAVE_MINIX2 | 1371 | #ifdef HAVE_MINIX2 |
@@ -1432,7 +1429,7 @@ extern int fsck_minix_main(int argc, char **argv) | |||
1432 | * flags and whether or not the -f switch was specified on the | 1429 | * flags and whether or not the -f switch was specified on the |
1433 | * command line. | 1430 | * command line. |
1434 | */ | 1431 | */ |
1435 | printf("%s, %s\n", program_name, program_version); | 1432 | printf("%s, %s\n", applet_name, program_version); |
1436 | if (!(Super.s_state & MINIX_ERROR_FS) && | 1433 | if (!(Super.s_state & MINIX_ERROR_FS) && |
1437 | (Super.s_state & MINIX_VALID_FS) && !force) { | 1434 | (Super.s_state & MINIX_VALID_FS) && !force) { |
1438 | if (repair) | 1435 | if (repair) |
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index c8c91123b..b6f958f46 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -202,7 +202,6 @@ struct minix_dir_entry { | |||
202 | 202 | ||
203 | #define BITS_PER_BLOCK (BLOCK_SIZE<<3) | 203 | #define BITS_PER_BLOCK (BLOCK_SIZE<<3) |
204 | 204 | ||
205 | static char *program_name = "mkfs"; | ||
206 | static char *device_name = NULL; | 205 | static char *device_name = NULL; |
207 | static int DEV = -1; | 206 | static int DEV = -1; |
208 | static long BLOCKS = 0; | 207 | static long BLOCKS = 0; |
@@ -264,7 +263,7 @@ static unsigned long req_nr_inodes = 0; | |||
264 | */ | 263 | */ |
265 | static volatile void die(char *str) | 264 | static volatile void die(char *str) |
266 | { | 265 | { |
267 | fprintf(stderr, "%s: %s\n", program_name, str); | 266 | fprintf(stderr, "%s: %s\n", applet_name, str); |
268 | exit(8); | 267 | exit(8); |
269 | } | 268 | } |
270 | 269 | ||
@@ -275,7 +274,7 @@ static volatile void show_usage() | |||
275 | BB_VER, BB_BT); | 274 | BB_VER, BB_BT); |
276 | fprintf(stderr, | 275 | fprintf(stderr, |
277 | "Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n", | 276 | "Usage: %s [-c | -l filename] [-nXX] [-iXX] /dev/name [blocks]\n", |
278 | program_name); | 277 | applet_name); |
279 | #ifndef BB_FEATURE_TRIVIAL_HELP | 278 | #ifndef BB_FEATURE_TRIVIAL_HELP |
280 | fprintf(stderr, "\nMake a MINIX filesystem.\n\n"); | 279 | fprintf(stderr, "\nMake a MINIX filesystem.\n\n"); |
281 | fprintf(stderr, "Options:\n"); | 280 | fprintf(stderr, "Options:\n"); |
@@ -745,8 +744,6 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
745 | char *listfile = NULL; | 744 | char *listfile = NULL; |
746 | int stopIt=FALSE; | 745 | int stopIt=FALSE; |
747 | 746 | ||
748 | if (argc && *argv) | ||
749 | program_name = *argv; | ||
750 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) | 747 | if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) |
751 | die("bad inode size"); | 748 | die("bad inode size"); |
752 | #ifdef HAVE_MINIX2 | 749 | #ifdef HAVE_MINIX2 |
@@ -818,7 +815,7 @@ extern int mkfs_minix_main(int argc, char **argv) | |||
818 | version2 = 1; | 815 | version2 = 1; |
819 | #else | 816 | #else |
820 | fprintf(stderr, "%s: not compiled with minix v2 support\n", | 817 | fprintf(stderr, "%s: not compiled with minix v2 support\n", |
821 | program_name, device_name); | 818 | applet_name, device_name); |
822 | exit(-1); | 819 | exit(-1); |
823 | #endif | 820 | #endif |
824 | break; | 821 | break; |
diff --git a/util-linux/mkswap.c b/util-linux/mkswap.c index fc37368f4..20096361f 100644 --- a/util-linux/mkswap.c +++ b/util-linux/mkswap.c | |||
@@ -69,7 +69,6 @@ static const char mkswap_usage[] = | |||
69 | #define BLKGETSIZE _IO(0x12,96) | 69 | #define BLKGETSIZE _IO(0x12,96) |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | static char *program_name = "mkswap"; | ||
73 | static char *device_name = NULL; | 72 | static char *device_name = NULL; |
74 | static int DEV = -1; | 73 | static int DEV = -1; |
75 | static long PAGES = 0; | 74 | static long PAGES = 0; |
@@ -205,7 +204,7 @@ static int bit_test_and_clear(unsigned int *addr, unsigned int nr) | |||
205 | 204 | ||
206 | void die(const char *str) | 205 | void die(const char *str) |
207 | { | 206 | { |
208 | fprintf(stderr, "%s: %s\n", program_name, str); | 207 | fprintf(stderr, "%s: %s\n", applet_name, str); |
209 | exit(FALSE); | 208 | exit(FALSE); |
210 | } | 209 | } |
211 | 210 | ||
@@ -316,9 +315,6 @@ int mkswap_main(int argc, char **argv) | |||
316 | int offset; | 315 | int offset; |
317 | int force = 0; | 316 | int force = 0; |
318 | 317 | ||
319 | if (argc && *argv) | ||
320 | program_name = *argv; | ||
321 | |||
322 | init_signature_page(); /* get pagesize */ | 318 | init_signature_page(); /* get pagesize */ |
323 | 319 | ||
324 | while (argc-- > 1) { | 320 | while (argc-- > 1) { |
@@ -350,7 +346,7 @@ int mkswap_main(int argc, char **argv) | |||
350 | } | 346 | } |
351 | if (!device_name) { | 347 | if (!device_name) { |
352 | fprintf(stderr, | 348 | fprintf(stderr, |
353 | "%s: error: Nowhere to set up swap on?\n", program_name); | 349 | "%s: error: Nowhere to set up swap on?\n", applet_name); |
354 | usage(mkswap_usage); | 350 | usage(mkswap_usage); |
355 | } | 351 | } |
356 | sz = get_size(device_name); | 352 | sz = get_size(device_name); |
@@ -360,7 +356,7 @@ int mkswap_main(int argc, char **argv) | |||
360 | fprintf(stderr, | 356 | fprintf(stderr, |
361 | "%s: error: " | 357 | "%s: error: " |
362 | "size %ld is larger than device size %d\n", | 358 | "size %ld is larger than device size %d\n", |
363 | program_name, | 359 | applet_name, |
364 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); | 360 | PAGES * (pagesize / 1024), sz * (pagesize / 1024)); |
365 | exit(FALSE); | 361 | exit(FALSE); |
366 | } | 362 | } |
@@ -377,13 +373,13 @@ int mkswap_main(int argc, char **argv) | |||
377 | } | 373 | } |
378 | if (version != 0 && version != 1) { | 374 | if (version != 0 && version != 1) { |
379 | fprintf(stderr, "%s: error: unknown version %d\n", | 375 | fprintf(stderr, "%s: error: unknown version %d\n", |
380 | program_name, version); | 376 | applet_name, version); |
381 | usage(mkswap_usage); | 377 | usage(mkswap_usage); |
382 | } | 378 | } |
383 | if (PAGES < 10) { | 379 | if (PAGES < 10) { |
384 | fprintf(stderr, | 380 | fprintf(stderr, |
385 | "%s: error: swap area needs to be at least %ldkB\n", | 381 | "%s: error: swap area needs to be at least %ldkB\n", |
386 | program_name, (long) (10 * pagesize / 1024)); | 382 | applet_name, (long) (10 * pagesize / 1024)); |
387 | usage(mkswap_usage); | 383 | usage(mkswap_usage); |
388 | } | 384 | } |
389 | #if 0 | 385 | #if 0 |
@@ -402,7 +398,7 @@ int mkswap_main(int argc, char **argv) | |||
402 | if (PAGES > maxpages) { | 398 | if (PAGES > maxpages) { |
403 | PAGES = maxpages; | 399 | PAGES = maxpages; |
404 | fprintf(stderr, "%s: warning: truncating swap area to %ldkB\n", | 400 | fprintf(stderr, "%s: warning: truncating swap area to %ldkB\n", |
405 | program_name, PAGES * pagesize / 1024); | 401 | applet_name, PAGES * pagesize / 1024); |
406 | } | 402 | } |
407 | 403 | ||
408 | DEV = open(device_name, O_RDWR); | 404 | DEV = open(device_name, O_RDWR); |
@@ -432,7 +428,7 @@ int mkswap_main(int argc, char **argv) | |||
432 | %s: Device '%s' contains a valid Sun disklabel.\n\ | 428 | %s: Device '%s' contains a valid Sun disklabel.\n\ |
433 | This probably means creating v0 swap would destroy your partition table\n\ | 429 | This probably means creating v0 swap would destroy your partition table\n\ |
434 | No swap created. If you really want to create swap v0 on that device, use\n\ | 430 | No swap created. If you really want to create swap v0 on that device, use\n\ |
435 | the -f option to force it.\n", program_name, device_name); | 431 | the -f option to force it.\n", applet_name, device_name); |
436 | exit(FALSE); | 432 | exit(FALSE); |
437 | } | 433 | } |
438 | } | 434 | } |
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c index b43f3cdc1..a79b93a23 100644 --- a/util-linux/swaponoff.c +++ b/util-linux/swaponoff.c | |||
@@ -34,7 +34,6 @@ _syscall1(int, swapoff, const char *, path); | |||
34 | 34 | ||
35 | 35 | ||
36 | static int whichApp; | 36 | static int whichApp; |
37 | static const char *appName; | ||
38 | 37 | ||
39 | static const char swapoff_usage[] = | 38 | static const char swapoff_usage[] = |
40 | "swapoff [OPTION] [device]\n" | 39 | "swapoff [OPTION] [device]\n" |
@@ -69,7 +68,7 @@ static void swap_enable_disable(char *device) | |||
69 | status = swapoff(device); | 68 | status = swapoff(device); |
70 | 69 | ||
71 | if (status != 0) { | 70 | if (status != 0) { |
72 | perror(appName); | 71 | perror(applet_name); |
73 | exit(FALSE); | 72 | exit(FALSE); |
74 | } | 73 | } |
75 | } | 74 | } |
@@ -95,12 +94,9 @@ static void do_em_all() | |||
95 | 94 | ||
96 | extern int swap_on_off_main(int argc, char **argv) | 95 | extern int swap_on_off_main(int argc, char **argv) |
97 | { | 96 | { |
98 | if (strcmp(*argv, "swapon") == 0) { | 97 | if (strcmp(applet_name, "swapon") == 0) { |
99 | appName = *argv; | ||
100 | whichApp = SWAPON_APP; | 98 | whichApp = SWAPON_APP; |
101 | |||
102 | } else { | 99 | } else { |
103 | appName = *argv; | ||
104 | whichApp = SWAPOFF_APP; | 100 | whichApp = SWAPOFF_APP; |
105 | } | 101 | } |
106 | 102 | ||