Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.busybox.net/busybox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-07-30 21:24:47 +0400
committerEric Andersen <andersen@codepoet.org>2004-07-30 21:24:47 +0400
commitaad29b37a7345207c94e8ef9f0bac943d43dbe12 (patch)
tree5dc7bdc6d5ffd211abc3e76e8b43f2e53fba3e10 /loginutils/login.c
parent15b588559bf75ebe15bc6ff29f3d591c4f35c0e8 (diff)
Fixup getty, login, etc so the utmp and wtmp are updated, allowing
the 'who' and 'last' applets among other things to work as expected. -Erik
Diffstat (limited to 'loginutils/login.c')
-rw-r--r--loginutils/login.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 20fab0753..93d81d314 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -403,8 +403,6 @@ static void motd ( )
#ifdef CONFIG_FEATURE_U_W_TMP
// vv Taken from tinylogin utmp.c vv
-#define _WTMP_FILE "/var/log/wtmp"
-
#define NO_UTENT \
"No utmp entry. You must exec \"login\" from the lowest level \"sh\""
#define NO_TTY \
@@ -480,6 +478,9 @@ static void setutmp(const char *name, const char *line)
setutent();
pututline(&utent);
endutent();
- updwtmp(_WTMP_FILE, &utent);
+ if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
+ creat(_PATH_WTMP, O_RDWR);
+ }
+ updwtmp(_PATH_WTMP, &utent);
}
#endif /* CONFIG_FEATURE_U_W_TMP */