diff options
-rw-r--r-- | archival/gunzip.c | 2 | ||||
-rw-r--r-- | coreutils/rmdir.c | 2 | ||||
-rw-r--r-- | coreutils/test.c | 2 | ||||
-rw-r--r-- | coreutils/whoami.c | 2 | ||||
-rw-r--r-- | fsck_minix.c | 9 | ||||
-rw-r--r-- | gunzip.c | 2 | ||||
-rw-r--r-- | init.c | 2 | ||||
-rw-r--r-- | init/init.c | 2 | ||||
-rw-r--r-- | kill.c | 3 | ||||
-rw-r--r-- | mkfs_minix.c | 9 | ||||
-rw-r--r-- | mkswap.c | 18 | ||||
-rw-r--r-- | procps/kill.c | 3 | ||||
-rw-r--r-- | rmdir.c | 2 | ||||
-rw-r--r-- | swaponoff.c | 8 | ||||
-rw-r--r-- | test.c | 2 | ||||
-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 | ||||
-rw-r--r-- | whoami.c | 2 |
20 files changed, 42 insertions, 72 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c index d6382aed0..e6b8202c8 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c | |||
@@ -592,7 +592,7 @@ int gunzip_main(int argc, char **argv) | |||
592 | char ifname[MAX_PATH_LEN + 1]; /* input file name */ | 592 | char ifname[MAX_PATH_LEN + 1]; /* input file name */ |
593 | char ofname[MAX_PATH_LEN + 1]; /* output file name */ | 593 | char ofname[MAX_PATH_LEN + 1]; /* output file name */ |
594 | 594 | ||
595 | if (strcmp(*argv, "zcat") == 0) { | 595 | if (strcmp(applet_name, "zcat") == 0) { |
596 | to_stdout = 1; | 596 | to_stdout = 1; |
597 | if (argc == 1) { | 597 | if (argc == 1) { |
598 | fromstdin = 1; | 598 | fromstdin = 1; |
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index 0751808c0..c88f42cf5 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c | |||
@@ -40,7 +40,7 @@ extern int rmdir_main(int argc, char **argv) | |||
40 | 40 | ||
41 | while (--argc > 0) { | 41 | while (--argc > 0) { |
42 | if (rmdir(*(++argv)) == -1) { | 42 | if (rmdir(*(++argv)) == -1) { |
43 | fprintf(stderr, "%s: %s\n", *argv, strerror(errno)); | 43 | fprintf(stderr, "%s: %s\n", applet_name, strerror(errno)); |
44 | exit(FALSE); | 44 | exit(FALSE); |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/coreutils/test.c b/coreutils/test.c index 36da4db0b..d7b34a6a4 100644 --- a/coreutils/test.c +++ b/coreutils/test.c | |||
@@ -183,7 +183,7 @@ test_main(int argc, char** argv) | |||
183 | { | 183 | { |
184 | int res; | 184 | int res; |
185 | 185 | ||
186 | if (strcmp(argv[0], "[") == 0) { | 186 | if (strcmp(applet_name, "[") == 0) { |
187 | if (strcmp(argv[--argc], "]")) | 187 | if (strcmp(argv[--argc], "]")) |
188 | fatalError("missing ]\n"); | 188 | fatalError("missing ]\n"); |
189 | argv[argc] = NULL; | 189 | argv[argc] = NULL; |
diff --git a/coreutils/whoami.c b/coreutils/whoami.c index 950f52fb2..983c6725d 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c | |||
@@ -43,7 +43,7 @@ extern int whoami_main(int argc, char **argv) | |||
43 | puts(user); | 43 | puts(user); |
44 | exit(TRUE); | 44 | exit(TRUE); |
45 | } | 45 | } |
46 | fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0], | 46 | fprintf(stderr, "%s: cannot find username for UID %u\n", applet_name, |
47 | (unsigned) uid); | 47 | (unsigned) uid); |
48 | return(FALSE); | 48 | return(FALSE); |
49 | } | 49 | } |
diff --git a/fsck_minix.c b/fsck_minix.c index 9533f40db..685e0ee6c 100644 --- a/fsck_minix.c +++ b/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) |
@@ -592,7 +592,7 @@ int gunzip_main(int argc, char **argv) | |||
592 | char ifname[MAX_PATH_LEN + 1]; /* input file name */ | 592 | char ifname[MAX_PATH_LEN + 1]; /* input file name */ |
593 | char ofname[MAX_PATH_LEN + 1]; /* output file name */ | 593 | char ofname[MAX_PATH_LEN + 1]; /* output file name */ |
594 | 594 | ||
595 | if (strcmp(*argv, "zcat") == 0) { | 595 | if (strcmp(applet_name, "zcat") == 0) { |
596 | to_stdout = 1; | 596 | to_stdout = 1; |
597 | if (argc == 1) { | 597 | if (argc == 1) { |
598 | fromstdin = 1; | 598 | fromstdin = 1; |
@@ -891,7 +891,7 @@ extern int init_main(int argc, char **argv) | |||
891 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ | 891 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ |
892 | if (getpid() != 1 | 892 | if (getpid() != 1 |
893 | #ifdef BB_FEATURE_LINUXRC | 893 | #ifdef BB_FEATURE_LINUXRC |
894 | && strstr(argv[0], "linuxrc") == NULL | 894 | && strstr(applet_name, "linuxrc") == NULL |
895 | #endif | 895 | #endif |
896 | ) | 896 | ) |
897 | { | 897 | { |
diff --git a/init/init.c b/init/init.c index 79f14ab33..f38d154b7 100644 --- a/init/init.c +++ b/init/init.c | |||
@@ -891,7 +891,7 @@ extern int init_main(int argc, char **argv) | |||
891 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ | 891 | /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ |
892 | if (getpid() != 1 | 892 | if (getpid() != 1 |
893 | #ifdef BB_FEATURE_LINUXRC | 893 | #ifdef BB_FEATURE_LINUXRC |
894 | && strstr(argv[0], "linuxrc") == NULL | 894 | && strstr(applet_name, "linuxrc") == NULL |
895 | #endif | 895 | #endif |
896 | ) | 896 | ) |
897 | { | 897 | { |
@@ -125,8 +125,7 @@ extern int kill_main(int argc, char **argv) | |||
125 | 125 | ||
126 | #ifdef BB_KILLALL | 126 | #ifdef BB_KILLALL |
127 | /* Figure out what we are trying to do here */ | 127 | /* Figure out what we are trying to do here */ |
128 | whichApp = (strcmp(*argv, "killall") == 0)? | 128 | whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; |
129 | KILLALL : KILL; | ||
130 | appUsage = (whichApp == KILLALL)? killall_usage : kill_usage; | 129 | appUsage = (whichApp == KILLALL)? killall_usage : kill_usage; |
131 | #else | 130 | #else |
132 | whichApp = KILL; | 131 | whichApp = KILL; |
diff --git a/mkfs_minix.c b/mkfs_minix.c index c8c91123b..b6f958f46 100644 --- a/mkfs_minix.c +++ b/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; |
@@ -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/procps/kill.c b/procps/kill.c index a0b93be2b..44cb38395 100644 --- a/procps/kill.c +++ b/procps/kill.c | |||
@@ -125,8 +125,7 @@ extern int kill_main(int argc, char **argv) | |||
125 | 125 | ||
126 | #ifdef BB_KILLALL | 126 | #ifdef BB_KILLALL |
127 | /* Figure out what we are trying to do here */ | 127 | /* Figure out what we are trying to do here */ |
128 | whichApp = (strcmp(*argv, "killall") == 0)? | 128 | whichApp = (strcmp(applet_name, "killall") == 0)? KILLALL : KILL; |
129 | KILLALL : KILL; | ||
130 | appUsage = (whichApp == KILLALL)? killall_usage : kill_usage; | 129 | appUsage = (whichApp == KILLALL)? killall_usage : kill_usage; |
131 | #else | 130 | #else |
132 | whichApp = KILL; | 131 | whichApp = KILL; |
@@ -40,7 +40,7 @@ extern int rmdir_main(int argc, char **argv) | |||
40 | 40 | ||
41 | while (--argc > 0) { | 41 | while (--argc > 0) { |
42 | if (rmdir(*(++argv)) == -1) { | 42 | if (rmdir(*(++argv)) == -1) { |
43 | fprintf(stderr, "%s: %s\n", *argv, strerror(errno)); | 43 | fprintf(stderr, "%s: %s\n", applet_name, strerror(errno)); |
44 | exit(FALSE); | 44 | exit(FALSE); |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/swaponoff.c b/swaponoff.c index b43f3cdc1..a79b93a23 100644 --- a/swaponoff.c +++ b/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 | ||
@@ -183,7 +183,7 @@ test_main(int argc, char** argv) | |||
183 | { | 183 | { |
184 | int res; | 184 | int res; |
185 | 185 | ||
186 | if (strcmp(argv[0], "[") == 0) { | 186 | if (strcmp(applet_name, "[") == 0) { |
187 | if (strcmp(argv[--argc], "]")) | 187 | if (strcmp(argv[--argc], "]")) |
188 | fatalError("missing ]\n"); | 188 | fatalError("missing ]\n"); |
189 | argv[argc] = NULL; | 189 | argv[argc] = NULL; |
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 | ||
@@ -43,7 +43,7 @@ extern int whoami_main(int argc, char **argv) | |||
43 | puts(user); | 43 | puts(user); |
44 | exit(TRUE); | 44 | exit(TRUE); |
45 | } | 45 | } |
46 | fprintf(stderr, "%s: cannot find username for UID %u\n", argv[0], | 46 | fprintf(stderr, "%s: cannot find username for UID %u\n", applet_name, |
47 | (unsigned) uid); | 47 | (unsigned) uid); |
48 | return(FALSE); | 48 | return(FALSE); |
49 | } | 49 | } |