aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--applets/applets.c2
-rw-r--r--applets/busybox.c15
-rw-r--r--applets/individual.c4
-rw-r--r--archival/bunzip2.c2
-rw-r--r--archival/gunzip.c2
-rw-r--r--archival/unlzma.c2
-rw-r--r--coreutils/cut.c1
-rw-r--r--coreutils/dos2unix.c2
-rw-r--r--docs/busybox.net/FAQ.html2
-rw-r--r--e2fsprogs/mke2fs.c2
-rw-r--r--e2fsprogs/tune2fs.c4
-rw-r--r--findutils/grep.c4
-rw-r--r--findutils/xargs.c4
-rw-r--r--include/libbb.h2
-rw-r--r--init/halt.c2
-rw-r--r--init/init.c4
-rw-r--r--init/init_shared.c2
-rw-r--r--libbb/copy_file.c2
-rw-r--r--libbb/remove_file.c6
-rw-r--r--libbb/verror_msg.c2
-rw-r--r--loginutils/deluser.c2
-rw-r--r--loginutils/getty.c2
-rw-r--r--loginutils/login.c2
-rw-r--r--loginutils/su.c2
-rw-r--r--loginutils/sulogin.c2
-rw-r--r--miscutils/crond.c4
-rw-r--r--miscutils/devfsd.c6
-rw-r--r--networking/fakeidentd.c2
-rw-r--r--networking/ftpgetput.c4
-rw-r--r--networking/ifupdown.c2
-rw-r--r--networking/inetd.c2
-rw-r--r--networking/nameif.c2
-rw-r--r--networking/telnetd.c2
-rw-r--r--networking/traceroute.c2
-rw-r--r--networking/udhcp/common.c4
-rw-r--r--networking/zcip.c2
-rw-r--r--procps/kill.c8
-rw-r--r--runit/chpst.c8
-rw-r--r--shell/ash.c4
-rw-r--r--shell/cmdedit.c2
-rw-r--r--shell/lash.c2
-rw-r--r--util-linux/freeramdisk.c2
-rw-r--r--util-linux/fsck_minix.c2
-rw-r--r--util-linux/mount.c2
-rw-r--r--util-linux/swaponoff.c2
45 files changed, 71 insertions, 69 deletions
diff --git a/applets/applets.c b/applets/applets.c
index d5b2672a0..d615ffcd8 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -469,7 +469,7 @@ void run_applet_by_name(const char *name, int argc, char **argv)
469 /* Do a binary search to find the applet entry given the name. */ 469 /* Do a binary search to find the applet entry given the name. */
470 applet_using = find_applet_by_name(name); 470 applet_using = find_applet_by_name(name);
471 if (applet_using) { 471 if (applet_using) {
472 bb_applet_name = applet_using->name; 472 applet_name = applet_using->name;
473 if(argc==2 && !strcmp(argv[1], "--help")) bb_show_usage(); 473 if(argc==2 && !strcmp(argv[1], "--help")) bb_show_usage();
474 if(ENABLE_FEATURE_SUID) check_suid(applet_using); 474 if(ENABLE_FEATURE_SUID) check_suid(applet_using);
475 exit((*(applet_using->main))(argc, argv)); 475 exit((*(applet_using->main))(argc, argv));
diff --git a/applets/busybox.c b/applets/busybox.c
index 53eb363ac..625a492f2 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -6,7 +6,7 @@
6 */ 6 */
7#include "busybox.h" 7#include "busybox.h"
8 8
9const char *bb_applet_name ATTRIBUTE_EXTERNALLY_VISIBLE; 9const char *applet_name ATTRIBUTE_EXTERNALLY_VISIBLE;
10 10
11#ifdef CONFIG_FEATURE_INSTALLER 11#ifdef CONFIG_FEATURE_INSTALLER
12/* 12/*
@@ -59,16 +59,16 @@ int main(int argc, char **argv)
59{ 59{
60 const char *s; 60 const char *s;
61 61
62 bb_applet_name=argv[0]; 62 applet_name=argv[0];
63 if (*bb_applet_name == '-') bb_applet_name++; 63 if (*applet_name == '-') applet_name++;
64 for (s = bb_applet_name; *s ;) 64 for (s = applet_name; *s ;)
65 if (*(s++) == '/') bb_applet_name = s; 65 if (*(s++) == '/') applet_name = s;
66 66
67 /* Set locale for everybody except `init' */ 67 /* Set locale for everybody except `init' */
68 if(ENABLE_LOCALE_SUPPORT && getpid() != 1) 68 if(ENABLE_LOCALE_SUPPORT && getpid() != 1)
69 setlocale(LC_ALL, ""); 69 setlocale(LC_ALL, "");
70 70
71 run_applet_by_name(bb_applet_name, argc, argv); 71 run_applet_by_name(applet_name, argc, argv);
72 bb_error_msg_and_die("applet not found"); 72 bb_error_msg_and_die("applet not found");
73} 73}
74 74
@@ -106,7 +106,8 @@ int busybox_main(int argc, char **argv)
106 106
107 if (argc==1 || !strcmp(argv[1],"--help") ) { 107 if (argc==1 || !strcmp(argv[1],"--help") ) {
108 if (argc>2) { 108 if (argc>2) {
109 run_applet_by_name(bb_applet_name=argv[2], 2, argv); 109 applet_name = argv[2];
110 run_applet_by_name(applet_name, 2, argv);
110 } else { 111 } else {
111 const struct BB_applet *a; 112 const struct BB_applet *a;
112 int col, output_width; 113 int col, output_width;
diff --git a/applets/individual.c b/applets/individual.c
index 911f760a6..b5d1e1298 100644
--- a/applets/individual.c
+++ b/applets/individual.c
@@ -5,7 +5,7 @@
5 * Licensed under GPL version 2, see file LICENSE in this tarball for details 5 * Licensed under GPL version 2, see file LICENSE in this tarball for details
6 */ 6 */
7 7
8const char *bb_applet_name; 8const char *applet_name;
9 9
10#include <stdio.h> 10#include <stdio.h>
11#include <stdlib.h> 11#include <stdlib.h>
@@ -14,7 +14,7 @@ const char *bb_applet_name;
14 14
15int main(int argc, char *argv[]) 15int main(int argc, char *argv[])
16{ 16{
17 bb_applet_name=argv[0]; 17 applet_name=argv[0];
18 18
19 return APPLET_main(argc,argv); 19 return APPLET_main(argc,argv);
20} 20}
diff --git a/archival/bunzip2.c b/archival/bunzip2.c
index faf997bbe..85f2343df 100644
--- a/archival/bunzip2.c
+++ b/archival/bunzip2.c
@@ -32,7 +32,7 @@ int bunzip2_main(int argc, char **argv)
32 } 32 }
33 33
34 /* if called as bzcat force the stdout flag */ 34 /* if called as bzcat force the stdout flag */
35 if ((opt & BUNZIP2_OPT_STDOUT) || bb_applet_name[2] == 'c') 35 if ((opt & BUNZIP2_OPT_STDOUT) || applet_name[2] == 'c')
36 filename = 0; 36 filename = 0;
37 37
38 /* Check that the input is sane. */ 38 /* Check that the input is sane. */
diff --git a/archival/gunzip.c b/archival/gunzip.c
index 1cde08b4d..396ce4f5c 100644
--- a/archival/gunzip.c
+++ b/archival/gunzip.c
@@ -44,7 +44,7 @@ int gunzip_main(int argc, char **argv)
44 44
45 opt = getopt32(argc, argv, "cftdv"); 45 opt = getopt32(argc, argv, "cftdv");
46 /* if called as zcat */ 46 /* if called as zcat */
47 if (strcmp(bb_applet_name, "zcat") == 0) { 47 if (strcmp(applet_name, "zcat") == 0) {
48 opt |= GUNZIP_OPT_STDOUT; 48 opt |= GUNZIP_OPT_STDOUT;
49 } 49 }
50 50
diff --git a/archival/unlzma.c b/archival/unlzma.c
index 20891e316..46fbefdc0 100644
--- a/archival/unlzma.c
+++ b/archival/unlzma.c
@@ -35,7 +35,7 @@ int unlzma_main(int argc, char **argv)
35 } 35 }
36 36
37 /* if called as lzmacat force the stdout flag */ 37 /* if called as lzmacat force the stdout flag */
38 if ((opt & UNLZMA_OPT_STDOUT) || bb_applet_name[4] == 'c') 38 if ((opt & UNLZMA_OPT_STDOUT) || applet_name[4] == 'c')
39 filename = 0; 39 filename = 0;
40 40
41 if (filename) { 41 if (filename) {
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 30dbc02db..69f28fa8d 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -13,6 +13,7 @@
13 13
14/* option vars */ 14/* option vars */
15static const char optstring[] = "b:c:f:d:sn"; 15static const char optstring[] = "b:c:f:d:sn";
16
16#define CUT_OPT_BYTE_FLGS (1<<0) 17#define CUT_OPT_BYTE_FLGS (1<<0)
17#define CUT_OPT_CHAR_FLGS (1<<1) 18#define CUT_OPT_CHAR_FLGS (1<<1)
18#define CUT_OPT_FIELDS_FLGS (1<<2) 19#define CUT_OPT_FIELDS_FLGS (1<<2)
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index a8038a6dd..1ed8771c0 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -87,7 +87,7 @@ int dos2unix_main(int argc, char *argv[])
87 int o; 87 int o;
88 88
89 /* See if we are supposed to be doing dos2unix or unix2dos */ 89 /* See if we are supposed to be doing dos2unix or unix2dos */
90 if (bb_applet_name[0] == 'd') { 90 if (applet_name[0] == 'd') {
91 ConvType = CT_DOS2UNIX; /*2 */ 91 ConvType = CT_DOS2UNIX; /*2 */
92 } else { 92 } else {
93 ConvType = CT_UNIX2DOS; /*1 */ 93 ConvType = CT_UNIX2DOS; /*1 */
diff --git a/docs/busybox.net/FAQ.html b/docs/busybox.net/FAQ.html
index af20366b6..2865ba108 100644
--- a/docs/busybox.net/FAQ.html
+++ b/docs/busybox.net/FAQ.html
@@ -521,7 +521,7 @@ busybox.c), and several subdirectories containing the code for the individual
521applets.</p> 521applets.</p>
522 522
523<p>Busybox execution starts with the main() function in applets/busybox.c, 523<p>Busybox execution starts with the main() function in applets/busybox.c,
524which sets the global variable bb_applet_name to argv[0] and calls 524which sets the global variable applet_name to argv[0] and calls
525run_applet_by_name() in applets/applets.c. That uses the applets[] array 525run_applet_by_name() in applets/applets.c. That uses the applets[] array
526(defined in include/busybox.h and filled out in include/applets.h) to 526(defined in include/busybox.h and filled out in include/applets.h) to
527transfer control to the appropriate APPLET_main() function (such as 527transfer control to the appropriate APPLET_main() function (such as
diff --git a/e2fsprogs/mke2fs.c b/e2fsprogs/mke2fs.c
index 72ce57458..f2cce75a3 100644
--- a/e2fsprogs/mke2fs.c
+++ b/e2fsprogs/mke2fs.c
@@ -841,7 +841,7 @@ static int PRS(int argc, char *argv[])
841#endif 841#endif
842 842
843 /* If called as mkfs.ext3, create a journal inode */ 843 /* If called as mkfs.ext3, create a journal inode */
844 if (last_char_is(bb_applet_name, '3')) 844 if (last_char_is(applet_name, '3'))
845 journal_size = -1; 845 journal_size = -1;
846 846
847 while ((c = getopt (argc, argv, 847 while ((c = getopt (argc, argv,
diff --git a/e2fsprogs/tune2fs.c b/e2fsprogs/tune2fs.c
index d64c12860..9bd6f4c7e 100644
--- a/e2fsprogs/tune2fs.c
+++ b/e2fsprogs/tune2fs.c
@@ -596,9 +596,9 @@ int tune2fs_main(int argc, char **argv)
596 if (ENABLE_FEATURE_CLEAN_UP) 596 if (ENABLE_FEATURE_CLEAN_UP)
597 atexit(tune2fs_clean_up); 597 atexit(tune2fs_clean_up);
598 598
599 if (ENABLE_FINDFS && (bb_applet_name[0] == 'f')) /* findfs */ 599 if (ENABLE_FINDFS && (applet_name[0] == 'f')) /* findfs */
600 do_findfs(argc, argv); /* no return */ 600 do_findfs(argc, argv); /* no return */
601 else if (ENABLE_E2LABEL && (bb_applet_name[0] == 'e')) /* e2label */ 601 else if (ENABLE_E2LABEL && (applet_name[0] == 'e')) /* e2label */
602 parse_e2label_options(argc, argv); 602 parse_e2label_options(argc, argv);
603 else 603 else
604 parse_tune2fs_options(argc, argv); /* tune2fs */ 604 parse_tune2fs_options(argc, argv); /* tune2fs */
diff --git a/findutils/grep.c b/findutils/grep.c
index 35e6aff2d..ce975e771 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -356,14 +356,14 @@ int grep_main(int argc, char **argv)
356 if (opt & GREP_OPT_f) 356 if (opt & GREP_OPT_f)
357 load_regexes_from_file(fopt); 357 load_regexes_from_file(fopt);
358 358
359 if (ENABLE_FEATURE_GREP_FGREP_ALIAS && bb_applet_name[0] == 'f') 359 if (ENABLE_FEATURE_GREP_FGREP_ALIAS && applet_name[0] == 'f')
360 opt |= GREP_OPT_F; 360 opt |= GREP_OPT_F;
361 361
362 if (!(opt & GREP_OPT_o)) 362 if (!(opt & GREP_OPT_o))
363 reflags = REG_NOSUB; 363 reflags = REG_NOSUB;
364 364
365 if (ENABLE_FEATURE_GREP_EGREP_ALIAS && 365 if (ENABLE_FEATURE_GREP_EGREP_ALIAS &&
366 (bb_applet_name[0] == 'e' || (opt & GREP_OPT_E))) 366 (applet_name[0] == 'e' || (opt & GREP_OPT_E)))
367 reflags |= REG_EXTENDED; 367 reflags |= REG_EXTENDED;
368 368
369 if (opt & GREP_OPT_i) 369 if (opt & GREP_OPT_i)
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 278382373..81997b6f6 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -523,12 +523,12 @@ int xargs_main(int argc, char **argv)
523 523
524#ifdef TEST 524#ifdef TEST
525 525
526const char *bb_applet_name = "debug stuff usage"; 526const char *applet_name = "debug stuff usage";
527 527
528void bb_show_usage(void) 528void bb_show_usage(void)
529{ 529{
530 fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n", 530 fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n",
531 bb_applet_name); 531 applet_name);
532 exit(1); 532 exit(1);
533} 533}
534 534
diff --git a/include/libbb.h b/include/libbb.h
index 4e96ea415..88847ac59 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -372,7 +372,7 @@ enum { /* DO NOT CHANGE THESE VALUES! cp.c depends on them. */
372 FILEUTILS_INTERACTIVE = 16 372 FILEUTILS_INTERACTIVE = 16
373}; 373};
374 374
375extern const char *bb_applet_name; 375extern const char *applet_name;
376 376
377extern const char bb_msg_full_version[]; 377extern const char bb_msg_full_version[];
378extern const char bb_msg_memory_exhausted[]; 378extern const char bb_msg_memory_exhausted[];
diff --git a/init/halt.c b/init/halt.c
index d796a4aea..2ac210e59 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -31,7 +31,7 @@ RB_AUTOBOOT
31 int which, flags, rc = 1; 31 int which, flags, rc = 1;
32 32
33 /* Figure out which applet we're running */ 33 /* Figure out which applet we're running */
34 for(which=0;delay[which]!=*bb_applet_name;which++); 34 for(which=0;delay[which]!=*applet_name;which++);
35 35
36 /* Parse and handle arguments */ 36 /* Parse and handle arguments */
37 flags = getopt32(argc, argv, "d:nf", &delay); 37 flags = getopt32(argc, argv, "d:nf", &delay);
diff --git a/init/init.c b/init/init.c
index d7d14a2d5..8257b7fb0 100644
--- a/init/init.c
+++ b/init/init.c
@@ -195,7 +195,7 @@ static void message(int device, const char *fmt, ...)
195 /* Log the message to syslogd */ 195 /* Log the message to syslogd */
196 if (device & LOG) { 196 if (device & LOG) {
197 /* don`t out "\r\n" */ 197 /* don`t out "\r\n" */
198 openlog(bb_applet_name, 0, LOG_DAEMON); 198 openlog(applet_name, 0, LOG_DAEMON);
199 syslog(LOG_INFO, "%s", msg + 1); 199 syslog(LOG_INFO, "%s", msg + 1);
200 closelog(); 200 closelog();
201 } 201 }
@@ -982,7 +982,7 @@ int init_main(int argc, char **argv)
982#if !ENABLE_DEBUG_INIT 982#if !ENABLE_DEBUG_INIT
983 /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */ 983 /* Expect to be invoked as init with PID=1 or be invoked as linuxrc */
984 if (getpid() != 1 && 984 if (getpid() != 1 &&
985 (!ENABLE_FEATURE_INITRD || !strstr(bb_applet_name, "linuxrc"))) 985 (!ENABLE_FEATURE_INITRD || !strstr(applet_name, "linuxrc")))
986 { 986 {
987 bb_show_usage(); 987 bb_show_usage();
988 } 988 }
diff --git a/init/init_shared.c b/init/init_shared.c
index 5e46abf09..47480fc21 100644
--- a/init/init_shared.c
+++ b/init/init_shared.c
@@ -31,7 +31,7 @@ int bb_shutdown_system(unsigned long magic)
31#endif 31#endif
32 reboot(RB_ENABLE_CAD); 32 reboot(RB_ENABLE_CAD);
33 33
34 openlog(bb_applet_name, 0, pri); 34 openlog(applet_name, 0, pri);
35 35
36 message = "\nThe system is going down NOW !!"; 36 message = "\nThe system is going down NOW !!";
37 syslog(pri, "%s", message); 37 syslog(pri, "%s", message);
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index d2794e7d6..bd9c9f7a2 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -127,7 +127,7 @@ int copy_file(const char *source, const char *dest, int flags)
127 127
128 if (dest_exists) { 128 if (dest_exists) {
129 if (flags & FILEUTILS_INTERACTIVE) { 129 if (flags & FILEUTILS_INTERACTIVE) {
130 fprintf(stderr, "%s: overwrite `%s'? ", bb_applet_name, dest); 130 fprintf(stderr, "%s: overwrite `%s'? ", applet_name, dest);
131 if (!bb_ask_confirmation()) { 131 if (!bb_ask_confirmation()) {
132 close (src_fd); 132 close (src_fd);
133 return 0; 133 return 0;
diff --git a/libbb/remove_file.c b/libbb/remove_file.c
index 92534a1c5..509aa6a6d 100644
--- a/libbb/remove_file.c
+++ b/libbb/remove_file.c
@@ -53,7 +53,7 @@ int remove_file(const char *path, int flags)
53 if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0 && 53 if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0 &&
54 isatty(0)) || 54 isatty(0)) ||
55 (flags & FILEUTILS_INTERACTIVE)) { 55 (flags & FILEUTILS_INTERACTIVE)) {
56 fprintf(stderr, "%s: descend into directory `%s'? ", bb_applet_name, 56 fprintf(stderr, "%s: descend into directory `%s'? ", applet_name,
57 path); 57 path);
58 if (!bb_ask_confirmation()) 58 if (!bb_ask_confirmation())
59 return 0; 59 return 0;
@@ -80,7 +80,7 @@ int remove_file(const char *path, int flags)
80 } 80 }
81 81
82 if (flags & FILEUTILS_INTERACTIVE) { 82 if (flags & FILEUTILS_INTERACTIVE) {
83 fprintf(stderr, "%s: remove directory `%s'? ", bb_applet_name, path); 83 fprintf(stderr, "%s: remove directory `%s'? ", applet_name, path);
84 if (!bb_ask_confirmation()) 84 if (!bb_ask_confirmation())
85 return status; 85 return status;
86 } 86 }
@@ -96,7 +96,7 @@ int remove_file(const char *path, int flags)
96 !S_ISLNK(path_stat.st_mode) && 96 !S_ISLNK(path_stat.st_mode) &&
97 isatty(0)) || 97 isatty(0)) ||
98 (flags & FILEUTILS_INTERACTIVE)) { 98 (flags & FILEUTILS_INTERACTIVE)) {
99 fprintf(stderr, "%s: remove `%s'? ", bb_applet_name, path); 99 fprintf(stderr, "%s: remove `%s'? ", applet_name, path);
100 if (!bb_ask_confirmation()) 100 if (!bb_ask_confirmation())
101 return 0; 101 return 0;
102 } 102 }
diff --git a/libbb/verror_msg.c b/libbb/verror_msg.c
index e670d40ba..0f018c517 100644
--- a/libbb/verror_msg.c
+++ b/libbb/verror_msg.c
@@ -22,7 +22,7 @@ void bb_verror_msg(const char *s, va_list p, const char* strerr)
22 22
23 if (logmode & LOGMODE_STDIO) { 23 if (logmode & LOGMODE_STDIO) {
24 fflush(stdout); 24 fflush(stdout);
25 fprintf(stderr, "%s: ", bb_applet_name); 25 fprintf(stderr, "%s: ", applet_name);
26 vfprintf(stderr, s, p); 26 vfprintf(stderr, s, p);
27 if (!strerr) 27 if (!strerr)
28 fputs(msg_eol, stderr); 28 fputs(msg_eol, stderr);
diff --git a/loginutils/deluser.c b/loginutils/deluser.c
index 0cd4671c8..f4320687e 100644
--- a/loginutils/deluser.c
+++ b/loginutils/deluser.c
@@ -81,7 +81,7 @@ int deluser_main(int argc, char **argv)
81 if (argc != 2) { 81 if (argc != 2) {
82 bb_show_usage(); 82 bb_show_usage();
83 } else { 83 } else {
84 if (ENABLE_DELUSER && bb_applet_name[3] == 'u') { 84 if (ENABLE_DELUSER && applet_name[3] == 'u') {
85 del_line_matching(argv[1], bb_path_passwd_file); 85 del_line_matching(argv[1], bb_path_passwd_file);
86 if (ENABLE_FEATURE_SHADOWPASSWDS) 86 if (ENABLE_FEATURE_SHADOWPASSWDS)
87 del_line_matching(argv[1], bb_path_shadow_file); 87 del_line_matching(argv[1], bb_path_shadow_file);
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 6730fa85c..4b43684a2 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -821,7 +821,7 @@ int getty_main(int argc, char **argv)
821 dup2(nullfd, 2); 821 dup2(nullfd, 2);
822 if(nullfd > 2) 822 if(nullfd > 2)
823 close(nullfd); 823 close(nullfd);
824 openlog(bb_applet_name, LOG_PID, LOG_AUTH); 824 openlog(applet_name, LOG_PID, LOG_AUTH);
825 logmode = LOGMODE_BOTH; 825 logmode = LOGMODE_BOTH;
826 826
827#ifdef DEBUGGING 827#ifdef DEBUGGING
diff --git a/loginutils/login.c b/loginutils/login.c
index 1f392c10f..8003922f9 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -268,7 +268,7 @@ int login_main(int argc, char **argv)
268 268
269 bb_setpgrp; 269 bb_setpgrp;
270 270
271 openlog(bb_applet_name, LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH); 271 openlog(applet_name, LOG_PID | LOG_CONS | LOG_NOWAIT, LOG_AUTH);
272 272
273 while (1) { 273 while (1) {
274 if (!username[0]) 274 if (!username[0])
diff --git a/loginutils/su.c b/loginutils/su.c
index 78942014e..a23ee932b 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -41,7 +41,7 @@ int su_main(int argc, char **argv)
41 in this case resort to getpwuid. */ 41 in this case resort to getpwuid. */
42 old_user = xstrdup(USE_FEATURE_UTMP(getlogin() ? : ) (pw = getpwuid(cur_uid)) ? pw->pw_name : ""); 42 old_user = xstrdup(USE_FEATURE_UTMP(getlogin() ? : ) (pw = getpwuid(cur_uid)) ? pw->pw_name : "");
43 tty = ttyname(2) ? : "none"; 43 tty = ttyname(2) ? : "none";
44 openlog(bb_applet_name, 0, LOG_AUTH); 44 openlog(applet_name, 0, LOG_AUTH);
45 } 45 }
46 46
47 pw = getpwnam(opt_username); 47 pw = getpwnam(opt_username);
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 6edd2582b..40eb5e9cf 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -44,7 +44,7 @@ int sulogin_main(int argc, char **argv)
44 struct spwd *spwd; 44 struct spwd *spwd;
45 45
46 logmode = LOGMODE_BOTH; 46 logmode = LOGMODE_BOTH;
47 openlog(bb_applet_name, 0, LOG_AUTH); 47 openlog(applet_name, 0, LOG_AUTH);
48 48
49 if (getopt32 (argc, argv, "t:", &timeout_arg)) { 49 if (getopt32 (argc, argv, "t:", &timeout_arg)) {
50 if (safe_strtoi(timeout_arg, &timeout)) { 50 if (safe_strtoi(timeout_arg, &timeout)) {
diff --git a/miscutils/crond.c b/miscutils/crond.c
index 4f25486dd..db0cc2c6b 100644
--- a/miscutils/crond.c
+++ b/miscutils/crond.c
@@ -205,7 +205,7 @@ int crond_main(int ac, char **av)
205 */ 205 */
206 206
207 crondlog("\011%s " VERSION " dillon, started, log level %d\n", 207 crondlog("\011%s " VERSION " dillon, started, log level %d\n",
208 bb_applet_name, LogLevel); 208 applet_name, LogLevel);
209 209
210 SynchronizeDir(); 210 SynchronizeDir();
211 211
@@ -305,7 +305,7 @@ static int ChangeUser(const char *user)
305static void startlogger(void) 305static void startlogger(void)
306{ 306{
307 if (LogFile == 0) { 307 if (LogFile == 0) {
308 openlog(bb_applet_name, LOG_CONS | LOG_PID, LOG_CRON); 308 openlog(applet_name, LOG_CONS | LOG_PID, LOG_CRON);
309 } 309 }
310#if ENABLE_DEBUG_CROND_OPTION 310#if ENABLE_DEBUG_CROND_OPTION
311 else { /* test logfile */ 311 else { /* test logfile */
diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c
index 0f36970f9..f1fee2c90 100644
--- a/miscutils/devfsd.c
+++ b/miscutils/devfsd.c
@@ -306,7 +306,7 @@ static void msg_logger(int pri, const char * fmt, ... )
306 va_start(ap, fmt); 306 va_start(ap, fmt);
307 ret = access ("/dev/log", F_OK); 307 ret = access ("/dev/log", F_OK);
308 if (ret == 0) { 308 if (ret == 0) {
309 openlog(bb_applet_name, 0, LOG_DAEMON); 309 openlog(applet_name, 0, LOG_DAEMON);
310 vsyslog( pri , fmt, ap); 310 vsyslog( pri , fmt, ap);
311 /* Man: A trailing newline is added when needed. */ 311 /* Man: A trailing newline is added when needed. */
312 closelog(); 312 closelog();
@@ -492,7 +492,7 @@ int devfsd_main (int argc, char **argv)
492 if ( print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) ) 492 if ( print_version || (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) )
493 { 493 {
494 bb_printf( "%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n", 494 bb_printf( "%s v%s\nDaemon %s:\t%d\nKernel-side %s:\t%d\n",
495 bb_applet_name,DEVFSD_VERSION,bb_msg_proto_rev, 495 applet_name,DEVFSD_VERSION,bb_msg_proto_rev,
496 DEVFSD_PROTOCOL_REVISION_DAEMON,bb_msg_proto_rev, proto_rev); 496 DEVFSD_PROTOCOL_REVISION_DAEMON,bb_msg_proto_rev, proto_rev);
497 if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev) 497 if (DEVFSD_PROTOCOL_REVISION_DAEMON != proto_rev)
498 bb_error_msg_and_die( "%s mismatch!",bb_msg_proto_rev); 498 bb_error_msg_and_die( "%s mismatch!",bb_msg_proto_rev);
@@ -509,7 +509,7 @@ int devfsd_main (int argc, char **argv)
509 if (sigaction (SIGHUP, &new_action, NULL) != 0 || sigaction (SIGUSR1, &new_action, NULL) != 0 ) 509 if (sigaction (SIGHUP, &new_action, NULL) != 0 || sigaction (SIGUSR1, &new_action, NULL) != 0 )
510 devfsd_error_msg_and_die( "sigaction"); 510 devfsd_error_msg_and_die( "sigaction");
511 511
512 bb_printf("%s v%s started for %s\n",bb_applet_name, DEVFSD_VERSION, mount_point); 512 bb_printf("%s v%s started for %s\n",applet_name, DEVFSD_VERSION, mount_point);
513 513
514 /* Set umask so that mknod(2), open(2) and mkdir(2) have complete control over permissions */ 514 /* Set umask so that mknod(2), open(2) and mkdir(2) have complete control over permissions */
515 umask (0); 515 umask (0);
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c
index 6070e5f2d..c8d32765a 100644
--- a/networking/fakeidentd.c
+++ b/networking/fakeidentd.c
@@ -219,7 +219,7 @@ static int checkInput(char *buf, int len, int l)
219int fakeidentd_main(int argc, char **argv) 219int fakeidentd_main(int argc, char **argv)
220{ 220{
221 /* This applet is an inetd-style daemon */ 221 /* This applet is an inetd-style daemon */
222 openlog(bb_applet_name, 0, LOG_DAEMON); 222 openlog(applet_name, 0, LOG_DAEMON);
223 logmode = LOGMODE_SYSLOG; 223 logmode = LOGMODE_SYSLOG;
224 224
225 memset(conns, 0, sizeof(conns)); 225 memset(conns, 0, sizeof(conns));
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c
index 25b7f1427..492854153 100644
--- a/networking/ftpgetput.c
+++ b/networking/ftpgetput.c
@@ -288,10 +288,10 @@ int ftpgetput_main(int argc, char **argv)
288 int (*ftp_action)(ftp_host_info_t *, FILE *, const char *, char *) = NULL; 288 int (*ftp_action)(ftp_host_info_t *, FILE *, const char *, char *) = NULL;
289 289
290 /* Check to see if the command is ftpget or ftput */ 290 /* Check to see if the command is ftpget or ftput */
291 if (ENABLE_FTPPUT && (!ENABLE_FTPGET || bb_applet_name[3] == 'p')) { 291 if (ENABLE_FTPPUT && (!ENABLE_FTPGET || applet_name[3] == 'p')) {
292 ftp_action = ftp_send; 292 ftp_action = ftp_send;
293 } 293 }
294 if (ENABLE_FTPGET && (!ENABLE_FTPPUT || bb_applet_name[3] == 'g')) { 294 if (ENABLE_FTPGET && (!ENABLE_FTPPUT || applet_name[3] == 'g')) {
295 ftp_action = ftp_receive; 295 ftp_action = ftp_receive;
296 } 296 }
297 297
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index f34287580..6334cbc43 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -1080,7 +1080,7 @@ int ifupdown_main(int argc, char **argv)
1080 int any_failures = 0; 1080 int any_failures = 0;
1081 int i; 1081 int i;
1082 1082
1083 if (bb_applet_name[2] == 'u') { 1083 if (applet_name[2] == 'u') {
1084 /* ifup command */ 1084 /* ifup command */
1085 cmds = iface_up; 1085 cmds = iface_up;
1086 } else { 1086 } else {
diff --git a/networking/inetd.c b/networking/inetd.c
index 350f91dc4..e22115a5c 100644
--- a/networking/inetd.c
+++ b/networking/inetd.c
@@ -1251,7 +1251,7 @@ inetd_main(int argc, char *argv[])
1251 LastArg = envp[-1] + strlen(envp[-1]); 1251 LastArg = envp[-1] + strlen(envp[-1]);
1252#endif 1252#endif
1253 1253
1254 openlog(bb_applet_name, LOG_PID | LOG_NOWAIT, LOG_DAEMON); 1254 openlog(applet_name, LOG_PID | LOG_NOWAIT, LOG_DAEMON);
1255 1255
1256 opt = getopt32(argc, argv, "R:f", &stoomany); 1256 opt = getopt32(argc, argv, "R:f", &stoomany);
1257 if(opt & 1) { 1257 if(opt & 1) {
diff --git a/networking/nameif.c b/networking/nameif.c
index 146eccea9..f60a97e8b 100644
--- a/networking/nameif.c
+++ b/networking/nameif.c
@@ -66,7 +66,7 @@ int nameif_main(int argc, char **argv)
66 mactable_t *ch; 66 mactable_t *ch;
67 67
68 if (1 & getopt32(argc, argv, "sc:", &fname)) { 68 if (1 & getopt32(argc, argv, "sc:", &fname)) {
69 openlog(bb_applet_name, 0, LOG_LOCAL0); 69 openlog(applet_name, 0, LOG_LOCAL0);
70 logmode = LOGMODE_SYSLOG; 70 logmode = LOGMODE_SYSLOG;
71 } 71 }
72 72
diff --git a/networking/telnetd.c b/networking/telnetd.c
index 808d4be51..1c4dede39 100644
--- a/networking/telnetd.c
+++ b/networking/telnetd.c
@@ -384,7 +384,7 @@ telnetd_main(int argc, char **argv)
384 * look into syslog for all errors, even early ones. 384 * look into syslog for all errors, even early ones.
385 * Direct all output to syslog at once. 385 * Direct all output to syslog at once.
386 */ 386 */
387 openlog(bb_applet_name, 0, LOG_USER); 387 openlog(applet_name, 0, LOG_USER);
388 logmode = LOGMODE_SYSLOG; 388 logmode = LOGMODE_SYSLOG;
389 389
390 opt = getopt32(argc, argv, "f:l:" USE_FEATURE_TELNETD_INETD("p:b:"), 390 opt = getopt32(argc, argv, "f:l:" USE_FEATURE_TELNETD_INETD("p:b:"),
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 042cbe35a..4af523625 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -697,7 +697,7 @@ send_probe(int seq, int ttl, struct timeval *tp)
697 if (cc < 0) 697 if (cc < 0)
698 bb_perror_msg_and_die("sendto"); 698 bb_perror_msg_and_die("sendto");
699 printf("%s: wrote %s %d chars, ret=%d\n", 699 printf("%s: wrote %s %d chars, ret=%d\n",
700 bb_applet_name, hostname, packlen, cc); 700 applet_name, hostname, packlen, cc);
701 (void)fflush(stdout); 701 (void)fflush(stdout);
702 } 702 }
703} 703}
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index c34b3de26..ca0c79b95 100644
--- a/networking/udhcp/common.c
+++ b/networking/udhcp/common.c
@@ -82,9 +82,9 @@ void udhcp_start_log_and_pid(const char *pidfile)
82 setlinebuf(stdout); 82 setlinebuf(stdout);
83 83
84 if (ENABLE_FEATURE_UDHCP_SYSLOG) { 84 if (ENABLE_FEATURE_UDHCP_SYSLOG) {
85 openlog(bb_applet_name, LOG_PID, LOG_LOCAL0); 85 openlog(applet_name, LOG_PID, LOG_LOCAL0);
86 logmode |= LOGMODE_SYSLOG; 86 logmode |= LOGMODE_SYSLOG;
87 } 87 }
88 88
89 bb_info_msg("%s (v%s) started", bb_applet_name, BB_VER); 89 bb_info_msg("%s (v%s) started", applet_name, BB_VER);
90} 90}
diff --git a/networking/zcip.c b/networking/zcip.c
index d9c1adf19..6bd7f255b 100644
--- a/networking/zcip.c
+++ b/networking/zcip.c
@@ -222,7 +222,7 @@ int zcip_main(int argc, char *argv[])
222 if (!FOREGROUND) { 222 if (!FOREGROUND) {
223 /* Do it early, before all bb_xx_msg calls */ 223 /* Do it early, before all bb_xx_msg calls */
224 logmode = LOGMODE_SYSLOG; 224 logmode = LOGMODE_SYSLOG;
225 openlog(bb_applet_name, 0, LOG_DAEMON); 225 openlog(applet_name, 0, LOG_DAEMON);
226 } 226 }
227 if (opts & 4) { // -r n.n.n.n 227 if (opts & 4) { // -r n.n.n.n
228 if (inet_aton(r_opt, &ip) == 0 228 if (inet_aton(r_opt, &ip) == 0
diff --git a/procps/kill.c b/procps/kill.c
index fe9b24200..2408a70ca 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -15,10 +15,10 @@ int kill_main(int argc, char **argv)
15 char *arg; 15 char *arg;
16 pid_t pid; 16 pid_t pid;
17 int signo = SIGTERM, errors = 0, quiet = 0; 17 int signo = SIGTERM, errors = 0, quiet = 0;
18 const int killall = (ENABLE_KILLALL && bb_applet_name[4]=='a' 18 const int killall = (ENABLE_KILLALL && applet_name[4]=='a'
19 && (!ENABLE_KILLALL5 || bb_applet_name[7]!='5')); 19 && (!ENABLE_KILLALL5 || applet_name[7]!='5'));
20 const int killall5 = (ENABLE_KILLALL5 && bb_applet_name[4]=='a' 20 const int killall5 = (ENABLE_KILLALL5 && applet_name[4]=='a'
21 && (!ENABLE_KILLALL || bb_applet_name[7]=='5')); 21 && (!ENABLE_KILLALL || applet_name[7]=='5'));
22 22
23 /* Parse any options */ 23 /* Parse any options */
24 argc--; 24 argc--;
diff --git a/runit/chpst.c b/runit/chpst.c
index ced28387d..1ee9b8d0f 100644
--- a/runit/chpst.c
+++ b/runit/chpst.c
@@ -230,10 +230,10 @@ static void softlimit(int, char **);
230 230
231int chpst_main(int argc, char **argv) 231int chpst_main(int argc, char **argv)
232{ 232{
233 if (bb_applet_name[3] == 'd') envdir(argc, argv); 233 if (applet_name[3] == 'd') envdir(argc, argv);
234 if (bb_applet_name[1] == 'o') softlimit(argc, argv); 234 if (applet_name[1] == 'o') softlimit(argc, argv);
235 if (bb_applet_name[0] == 's') setuidgid(argc, argv); 235 if (applet_name[0] == 's') setuidgid(argc, argv);
236 if (bb_applet_name[0] == 'e') envuidgid(argc, argv); 236 if (applet_name[0] == 'e') envuidgid(argc, argv);
237 // otherwise we are.......... chpst 237 // otherwise we are.......... chpst
238 238
239 { 239 {
diff --git a/shell/ash.c b/shell/ash.c
index 7d4da434e..0d9fa7fe2 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3753,7 +3753,7 @@ tryexec(char *cmd, char **argv, char **envp)
3753 while (*c != NULL) { 3753 while (*c != NULL) {
3754 c++; argc++; 3754 c++; argc++;
3755 } 3755 }
3756 bb_applet_name = cmd; 3756 applet_name = cmd;
3757 exit(a->main(argc, argv)); 3757 exit(a->main(argc, argv));
3758 } 3758 }
3759#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL 3759#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
@@ -13658,7 +13658,7 @@ static arith_t arith (const char *expr, int *perrcode)
13658 13658
13659 13659
13660#ifdef DEBUG 13660#ifdef DEBUG
13661const char *bb_applet_name = "debug stuff usage"; 13661const char *applet_name = "debug stuff usage";
13662int main(int argc, char **argv) 13662int main(int argc, char **argv)
13663{ 13663{
13664 return ash_main(argc, argv); 13664 return ash_main(argc, argv);
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index 9a57f750e..a9fc84798 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -1892,7 +1892,7 @@ rewrite_line:
1892 1892
1893#ifdef TEST 1893#ifdef TEST
1894 1894
1895const char *bb_applet_name = "debug stuff usage"; 1895const char *applet_name = "debug stuff usage";
1896 1896
1897#ifdef CONFIG_FEATURE_NONPRINTABLE_INVERSE_PUT 1897#ifdef CONFIG_FEATURE_NONPRINTABLE_INVERSE_PUT
1898#include <locale.h> 1898#include <locale.h>
diff --git a/shell/lash.c b/shell/lash.c
index 9c862a17f..c499612cc 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -1145,7 +1145,7 @@ static int pseudo_exec(struct child_prog *child)
1145 /* Check if the command matches any of the forking builtins. */ 1145 /* Check if the command matches any of the forking builtins. */
1146 for (x = bltins_forking; x->cmd; x++) { 1146 for (x = bltins_forking; x->cmd; x++) {
1147 if (strcmp(child->argv[0], x->cmd) == 0) { 1147 if (strcmp(child->argv[0], x->cmd) == 0) {
1148 bb_applet_name=x->cmd; 1148 applet_name=x->cmd;
1149 _exit (x->function(child)); 1149 _exit (x->function(child));
1150 } 1150 }
1151 } 1151 }
diff --git a/util-linux/freeramdisk.c b/util-linux/freeramdisk.c
index 5d110bc4b..2293d3ee6 100644
--- a/util-linux/freeramdisk.c
+++ b/util-linux/freeramdisk.c
@@ -24,7 +24,7 @@ int freeramdisk_main(int argc, char **argv)
24 fd = xopen(argv[1], O_RDWR); 24 fd = xopen(argv[1], O_RDWR);
25 25
26 // Act like freeramdisk, fdflush, or both depending on configuration. 26 // Act like freeramdisk, fdflush, or both depending on configuration.
27 result = ioctl(fd, (ENABLE_FREERAMDISK && bb_applet_name[1]=='r') 27 result = ioctl(fd, (ENABLE_FREERAMDISK && applet_name[1]=='r')
28 || !ENABLE_FDFLUSH ? BLKFLSBUF : FDFLUSH); 28 || !ENABLE_FDFLUSH ? BLKFLSBUF : FDFLUSH);
29 29
30 if (ENABLE_FEATURE_CLEAN_UP) close(fd); 30 if (ENABLE_FEATURE_CLEAN_UP) close(fd);
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index c0dda2f1f..a2ca7a566 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -1343,7 +1343,7 @@ int fsck_minix_main(int argc, char **argv)
1343 * flags and whether or not the -f switch was specified on the 1343 * flags and whether or not the -f switch was specified on the
1344 * command line. 1344 * command line.
1345 */ 1345 */
1346 printf("%s, %s\n", bb_applet_name, program_version); 1346 printf("%s, %s\n", applet_name, program_version);
1347 if (!(Super.s_state & MINIX_ERROR_FS) && 1347 if (!(Super.s_state & MINIX_ERROR_FS) &&
1348 (Super.s_state & MINIX_VALID_FS) && !force) { 1348 (Super.s_state & MINIX_VALID_FS) && !force) {
1349 if (repair) 1349 if (repair)
diff --git a/util-linux/mount.c b/util-linux/mount.c
index 899bf8557..141517ba0 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -707,7 +707,7 @@ static int daemonize(void)
707 dup2(fd, 2); 707 dup2(fd, 2);
708 if (fd > 2) close(fd); 708 if (fd > 2) close(fd);
709 setsid(); 709 setsid();
710 openlog(bb_applet_name, LOG_PID, LOG_DAEMON); 710 openlog(applet_name, LOG_PID, LOG_DAEMON);
711 logmode = LOGMODE_SYSLOG; 711 logmode = LOGMODE_SYSLOG;
712 return 1; 712 return 1;
713} 713}
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 4fcb239b6..8434d121c 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -24,7 +24,7 @@ static int swap_enable_disable(char *device)
24 if (st.st_blocks * 512 < st.st_size) 24 if (st.st_blocks * 512 < st.st_size)
25 bb_error_msg_and_die("swap file has holes"); 25 bb_error_msg_and_die("swap file has holes");
26 26
27 if (bb_applet_name[5] == 'n') 27 if (applet_name[5] == 'n')
28 status = swapon(device, 0); 28 status = swapon(device, 0);
29 else 29 else
30 status = swapoff(device); 30 status = swapoff(device);