aboutsummaryrefslogtreecommitdiff
path: root/libbb/setup_environment.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/setup_environment.c')
-rw-r--r--libbb/setup_environment.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libbb/setup_environment.c b/libbb/setup_environment.c
index 37777204e..3549e2099 100644
--- a/libbb/setup_environment.c
+++ b/libbb/setup_environment.c
@@ -37,8 +37,7 @@ void FAST_FUNC setup_environment(const char *shell, int flags, const struct pass
37 /* Change the current working directory to be the home directory 37 /* Change the current working directory to be the home directory
38 * of the user */ 38 * of the user */
39 if (flags & SETUP_ENV_CHDIR) { 39 if (flags & SETUP_ENV_CHDIR) {
40 if (chdir(pw->pw_dir) != 0) { 40 if (chdir_or_warn(pw->pw_dir) != 0) {
41 bb_error_msg("can't change directory to '%s'", pw->pw_dir);
42 xchdir((flags & SETUP_ENV_TO_TMP) ? "/tmp" : "/"); 41 xchdir((flags & SETUP_ENV_TO_TMP) ? "/tmp" : "/");
43 } 42 }
44 } 43 }