diff options
author | Karel Zak | 2016-08-16 12:35:57 +0200 |
---|---|---|
committer | Karel Zak | 2016-08-16 12:35:57 +0200 |
commit | 05d8868d86104c26aee8a1a30192243d0f9d2682 (patch) | |
tree | e878c026380c34b1a7cceca7bd3982160593a900 /login-utils | |
parent | Merge branch 'misc' of https://github.com/kerolasa/lelux-utiliteetit (diff) | |
download | kernel-qcow2-util-linux-05d8868d86104c26aee8a1a30192243d0f9d2682.tar.gz kernel-qcow2-util-linux-05d8868d86104c26aee8a1a30192243d0f9d2682.tar.xz kernel-qcow2-util-linux-05d8868d86104c26aee8a1a30192243d0f9d2682.zip |
include/env: minor fixes and clean ups
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils')
-rw-r--r-- | login-utils/login.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/login-utils/login.c b/login-utils/login.c index 1de24a8b8..2350fc3ec 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -1047,13 +1047,14 @@ static void init_environ(struct login_context *cxt) xsetenv("TERM", termenv ? termenv : "dumb", 1); free(termenv); - if (pwd->pw_uid) + if (pwd->pw_uid) { if (logindefs_setenv("PATH", "ENV_PATH", _PATH_DEFPATH) != 0) err(EXIT_FAILURE, _("failed to set the %s environment variable"), "PATH"); - else if (logindefs_setenv("PATH", "ENV_ROOTPATH", NULL) != 0) - if (logindefs_setenv("PATH", "ENV_SUPATH", _PATH_DEFPATH_ROOT) != 0) + } else if (logindefs_setenv("PATH", "ENV_ROOTPATH", NULL) != 0 && + logindefs_setenv("PATH", "ENV_SUPATH", _PATH_DEFPATH_ROOT) != 0) { err(EXIT_FAILURE, _("failed to set the %s environment variable"), "PATH"); + } /* mailx will give a funny error msg if you forget this one */ len = snprintf(tmp, sizeof(tmp), "%s/%s", _PATH_MAILDIR, pwd->pw_name); |