diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 08:42:43 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-03-17 08:42:43 +0000 |
commit | cdf62770af9e8bf7d5bb2344ddef8acb3216cfe2 (patch) | |
tree | f3c72eba4318ead484dfb36c6e21d55f443c5f6b /libbb | |
parent | 107fe7c081c2e0ab96628b431d9d812cdf9c82b2 (diff) | |
download | busybox-w32-cdf62770af9e8bf7d5bb2344ddef8acb3216cfe2.tar.gz busybox-w32-cdf62770af9e8bf7d5bb2344ddef8acb3216cfe2.tar.bz2 busybox-w32-cdf62770af9e8bf7d5bb2344ddef8acb3216cfe2.zip |
dos2unix: tiny shrink
login,su: fix setup_environment() so that it works as intended
(parameter names were a bit misleading)
fdisk: shrink
help text: shrink
function old new delta
login_main 1658 1701 +43
setup_environment 206 203 -3
dos_compatible_flag 4 1 -3
dos2unix_main 383 375 -8
get_boot 1724 1702 -22
fdisk_main 2949 2889 -60
packed_usage 24250 23948 -302
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/6 up/down: 43/-398) Total: -355 bytes
text data bss dec hex filename
798768 661 7428 806857 c4fc9 busybox_old
798327 658 7428 806413 c4e0d busybox_unstripped
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/setup_environment.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c index 19a2c6db5..6e3575cf9 100644 --- a/libbb/setup_environment.c +++ b/libbb/setup_environment.c | |||
@@ -30,16 +30,16 @@ | |||
30 | 30 | ||
31 | #include "libbb.h" | 31 | #include "libbb.h" |
32 | 32 | ||
33 | void setup_environment(const char *shell, int loginshell, int changeenv, const struct passwd *pw) | 33 | void setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw) |
34 | { | 34 | { |
35 | if (loginshell) { | 35 | if (clear_env) { |
36 | const char *term; | 36 | const char *term; |
37 | 37 | ||
38 | /* Change the current working directory to be the home directory | 38 | /* Change the current working directory to be the home directory |
39 | * of the user */ | 39 | * of the user */ |
40 | if (chdir(pw->pw_dir)) { | 40 | if (chdir(pw->pw_dir)) { |
41 | xchdir("/"); | 41 | xchdir("/"); |
42 | fputs("warning: cannot change to home directory\n", stderr); | 42 | bb_error_msg("can't chdir to home directory '%s'", pw->pw_dir); |
43 | } | 43 | } |
44 | 44 | ||
45 | /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. | 45 | /* Leave TERM unchanged. Set HOME, SHELL, USER, LOGNAME, PATH. |
@@ -56,7 +56,7 @@ void setup_environment(const char *shell, int loginshell, int changeenv, const s | |||
56 | //xsetenv("HOME", pw->pw_dir); | 56 | //xsetenv("HOME", pw->pw_dir); |
57 | //xsetenv("SHELL", shell); | 57 | //xsetenv("SHELL", shell); |
58 | } | 58 | } |
59 | else if (changeenv) { | 59 | else if (change_env) { |
60 | /* Set HOME, SHELL, and if not becoming a super-user, | 60 | /* Set HOME, SHELL, and if not becoming a super-user, |
61 | USER and LOGNAME. */ | 61 | USER and LOGNAME. */ |
62 | if (pw->pw_uid) { | 62 | if (pw->pw_uid) { |