summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer2006-05-26 14:41:40 +0000
committerBernhard Reutner-Fischer2006-05-26 14:41:40 +0000
commit781e42d66c120183e4dea1058dc539bdc4c53651 (patch)
treeb139320b4b1275de767168b811ca45d1523f0573 /loginutils
parentb180e5a76678f697b2a368e2ef607d299d06a3ae (diff)
downloadbusybox-781e42d66c120183e4dea1058dc539bdc4c53651.zip
busybox-781e42d66c120183e4dea1058dc539bdc4c53651.tar.gz
- introduce and use bb_path_wtmp_file for portability (saves 11 Bytes).
- fix last.c to also look at the double-underscore UT_ defines.
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c6
-rw-r--r--loginutils/login.c8
2 files changed, 7 insertions, 7 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 24d579f..43a82df 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -496,9 +496,9 @@ static void update_utmp(char *line)
endutent();
#ifdef CONFIG_FEATURE_WTMP
- if (access(_PATH_WTMP, R_OK|W_OK) == -1)
- close(creat(_PATH_WTMP, 0664));
- updwtmp(_PATH_WTMP, &ut);
+ if (access(bb_path_wtmp_file, R_OK|W_OK) == -1)
+ close(creat(bb_path_wtmp_file, 0664));
+ updwtmp(bb_path_wtmp_file, &ut);
#endif
}
diff --git a/loginutils/login.c b/loginutils/login.c
index 46766c5..b136732 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -463,7 +463,7 @@ static void checkutmp(int picky)
static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED)
{
time_t t_tmp = (time_t)utent.ut_time;
-
+
utent.ut_type = USER_PROCESS;
strncpy(utent.ut_user, name, sizeof utent.ut_user);
time(&t_tmp);
@@ -472,10 +472,10 @@ static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED)
pututline(&utent);
endutent();
#ifdef CONFIG_FEATURE_WTMP
- if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
- close(creat(_PATH_WTMP, 0664));
+ if (access(bb_path_wtmp_file, R_OK|W_OK) == -1) {
+ close(creat(bb_path_wtmp_file, 0664));
}
- updwtmp(_PATH_WTMP, &utent);
+ updwtmp(bb_path_wtmp_file, &utent);
#endif
}
#endif /* CONFIG_FEATURE_UTMP */