diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 08:52:02 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-12 08:52:02 +0000 |
commit | 15611bb95815de14bcb35f66bd10089a322ea30b (patch) | |
tree | 818f4e4a208cc04e37f2ea12fd4bda4eae30dd4c | |
parent | 16d58d75ee11f3b50550fbef7da12a4adbab66d4 (diff) | |
download | busybox-w32-15611bb95815de14bcb35f66bd10089a322ea30b.tar.gz busybox-w32-15611bb95815de14bcb35f66bd10089a322ea30b.tar.bz2 busybox-w32-15611bb95815de14bcb35f66bd10089a322ea30b.zip |
A few more string duplicates found & eliminated
# size busybox_old busybox_unstripped
text data bss dec hex filename
679693 2700 15632 698025 aa6a9 busybox_old
679523 2700 15632 697855 aa5ff busybox_unstripped
-rw-r--r-- | archival/dpkg.c | 2 | ||||
-rw-r--r-- | include/libbb.h | 4 | ||||
-rw-r--r-- | libbb/messages.c | 4 | ||||
-rw-r--r-- | libbb/setup_environment.c | 7 | ||||
-rw-r--r-- | modutils/insmod.c | 17 | ||||
-rw-r--r-- | shell/msh.c | 4 |
6 files changed, 18 insertions, 20 deletions
diff --git a/archival/dpkg.c b/archival/dpkg.c index 0ca2704a1..c40a932ec 100644 --- a/archival/dpkg.c +++ b/archival/dpkg.c | |||
@@ -714,7 +714,7 @@ static const char *describe_status(int status_num) | |||
714 | { | 714 | { |
715 | int status_want, status_state ; | 715 | int status_want, status_state ; |
716 | if (status_hashtable[status_num] == NULL || status_hashtable[status_num]->status == 0) | 716 | if (status_hashtable[status_num] == NULL || status_hashtable[status_num]->status == 0) |
717 | return "is not installed or flagged to be installed\n"; | 717 | return "is not installed or flagged to be installed"; |
718 | 718 | ||
719 | status_want = get_status(status_num, 1); | 719 | status_want = get_status(status_num, 1); |
720 | status_state = get_status(status_num, 3); | 720 | status_state = get_status(status_num, 3); |
diff --git a/include/libbb.h b/include/libbb.h index a32a74253..d42ce5f39 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -953,6 +953,10 @@ extern const char bb_path_motd_file[]; | |||
953 | extern const char bb_path_wtmp_file[]; | 953 | extern const char bb_path_wtmp_file[]; |
954 | extern const char bb_dev_null[]; | 954 | extern const char bb_dev_null[]; |
955 | extern const char bb_busybox_exec_path[]; | 955 | extern const char bb_busybox_exec_path[]; |
956 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | ||
957 | * but I want to save a few bytes here */ | ||
958 | extern const char bb_default_root_login_path[]; /* "/sbin:/usr/sbin:/bin:/usr/bin" */ | ||
959 | #define bb_default_login_path (bb_default_root_login_path + sizeof("/sbin:/usr/sbin")) | ||
956 | 960 | ||
957 | extern const int const_int_0; | 961 | extern const int const_int_0; |
958 | extern const int const_int_1; | 962 | extern const int const_int_1; |
diff --git a/libbb/messages.c b/libbb/messages.c index 16aaea553..9f62b9b0d 100644 --- a/libbb/messages.c +++ b/libbb/messages.c | |||
@@ -40,6 +40,10 @@ const char bb_path_motd_file[] = "/etc/motd"; | |||
40 | const char bb_dev_null[] = "/dev/null"; | 40 | const char bb_dev_null[] = "/dev/null"; |
41 | const char bb_busybox_exec_path[] = CONFIG_BUSYBOX_EXEC_PATH; | 41 | const char bb_busybox_exec_path[] = CONFIG_BUSYBOX_EXEC_PATH; |
42 | const char bb_default_login_shell[] = LIBBB_DEFAULT_LOGIN_SHELL; | 42 | const char bb_default_login_shell[] = LIBBB_DEFAULT_LOGIN_SHELL; |
43 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | ||
44 | * but I want to save a few bytes here. Check libbb.h before changing! */ | ||
45 | const char bb_default_root_login_path[] = "/sbin:/usr/sbin:/bin:/usr/bin"; | ||
46 | |||
43 | 47 | ||
44 | const int const_int_0; | 48 | const int const_int_0; |
45 | const int const_int_1 = 1; | 49 | const int const_int_1 = 1; |
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index 18d5a0610..a98b9a5bd 100644 --- a/libbb/setup_environment.c +++ b/libbb/setup_environment.c | |||
@@ -30,11 +30,6 @@ | |||
30 | 30 | ||
31 | #include "libbb.h" | 31 | #include "libbb.h" |
32 | 32 | ||
33 | /* util-linux manpage says /sbin:/bin:/usr/sbin:/usr/bin, | ||
34 | * but I want to save a few bytes here */ | ||
35 | static const char DEFAULT_ROOT_LOGIN_PATH[] = "/sbin:/usr/sbin:/bin:/usr/bin"; | ||
36 | #define DEFAULT_LOGIN_PATH (DEFAULT_ROOT_LOGIN_PATH + sizeof("/sbin:/usr/sbin")) | ||
37 | |||
38 | void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw) | 33 | void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw) |
39 | { | 34 | { |
40 | if (loginshell) { | 35 | if (loginshell) { |
@@ -61,7 +56,7 @@ void setup_environment(const char *shell, int loginshell, int changeenv, const s | |||
61 | xsetenv("SHELL", shell); | 56 | xsetenv("SHELL", shell); |
62 | xsetenv("USER", pw->pw_name); | 57 | xsetenv("USER", pw->pw_name); |
63 | xsetenv("LOGNAME", pw->pw_name); | 58 | xsetenv("LOGNAME", pw->pw_name); |
64 | xsetenv("PATH", (pw->pw_uid ? DEFAULT_LOGIN_PATH : DEFAULT_ROOT_LOGIN_PATH)); | 59 | xsetenv("PATH", (pw->pw_uid ? bb_default_login_path : bb_default_root_login_path)); |
65 | } | 60 | } |
66 | else if (changeenv) { | 61 | else if (changeenv) { |
67 | /* Set HOME, SHELL, and if not becoming a super-user, | 62 | /* Set HOME, SHELL, and if not becoming a super-user, |
diff --git a/modutils/insmod.c b/modutils/insmod.c index c84e2b96c..a81ca7fba 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -4112,18 +4112,13 @@ int insmod_main( int argc, char **argv) | |||
4112 | } | 4112 | } |
4113 | 4113 | ||
4114 | if (strncmp(uts_info.release, m_strversion, STRVERSIONLEN) != 0) { | 4114 | if (strncmp(uts_info.release, m_strversion, STRVERSIONLEN) != 0) { |
4115 | if (flag_force_load) { | 4115 | bb_error_msg("%skernel-module version mismatch\n" |
4116 | bb_error_msg("warning: kernel-module version mismatch\n" | 4116 | "\t%s was compiled for kernel version %s\n" |
4117 | "\t%s was compiled for kernel version %s\n" | 4117 | "\twhile this kernel is version %s", |
4118 | "\twhile this kernel is version %s", | 4118 | flag_force_load ? "warning: " : "", |
4119 | m_filename, m_strversion, uts_info.release); | 4119 | m_filename, m_strversion, uts_info.release); |
4120 | } else { | 4120 | if (!flag_force_load) |
4121 | bb_error_msg("kernel-module version mismatch\n" | ||
4122 | "\t%s was compiled for kernel version %s\n" | ||
4123 | "\twhile this kernel is version %s.", | ||
4124 | m_filename, m_strversion, uts_info.release); | ||
4125 | goto out; | 4121 | goto out; |
4126 | } | ||
4127 | } | 4122 | } |
4128 | } | 4123 | } |
4129 | k_crcs = 0; | 4124 | k_crcs = 0; |
diff --git a/shell/msh.c b/shell/msh.c index aab805ff5..2ee5256f7 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -5213,9 +5213,9 @@ int msh_main(int argc, char **argv) | |||
5213 | if (path->value == null) { | 5213 | if (path->value == null) { |
5214 | /* Can be merged with same string elsewhere in bbox */ | 5214 | /* Can be merged with same string elsewhere in bbox */ |
5215 | if (geteuid() == 0) | 5215 | if (geteuid() == 0) |
5216 | setval(path, "/sbin:/usr/sbin:/bin:/usr/bin"); | 5216 | setval(path, bb_default_root_login_path); |
5217 | else | 5217 | else |
5218 | setval(path, "/sbin:/usr/sbin:/bin:/usr/bin" + sizeof("/sbin:/usr/sbin")); | 5218 | setval(path, bb_default_login_path); |
5219 | } | 5219 | } |
5220 | export(path); | 5220 | export(path); |
5221 | 5221 | ||