diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-05-26 14:41:40 +0000 |
---|---|---|
committer | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2006-05-26 14:41:40 +0000 |
commit | 781e42d66c120183e4dea1058dc539bdc4c53651 (patch) | |
tree | b139320b4b1275de767168b811ca45d1523f0573 /loginutils | |
parent | b180e5a76678f697b2a368e2ef607d299d06a3ae (diff) | |
download | busybox-w32-781e42d66c120183e4dea1058dc539bdc4c53651.tar.gz busybox-w32-781e42d66c120183e4dea1058dc539bdc4c53651.tar.bz2 busybox-w32-781e42d66c120183e4dea1058dc539bdc4c53651.zip |
- 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.c | 6 | ||||
-rw-r--r-- | loginutils/login.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c index 24d579f75..43a82df66 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c | |||
@@ -496,9 +496,9 @@ static void update_utmp(char *line) | |||
496 | endutent(); | 496 | endutent(); |
497 | 497 | ||
498 | #ifdef CONFIG_FEATURE_WTMP | 498 | #ifdef CONFIG_FEATURE_WTMP |
499 | if (access(_PATH_WTMP, R_OK|W_OK) == -1) | 499 | if (access(bb_path_wtmp_file, R_OK|W_OK) == -1) |
500 | close(creat(_PATH_WTMP, 0664)); | 500 | close(creat(bb_path_wtmp_file, 0664)); |
501 | updwtmp(_PATH_WTMP, &ut); | 501 | updwtmp(bb_path_wtmp_file, &ut); |
502 | #endif | 502 | #endif |
503 | } | 503 | } |
504 | 504 | ||
diff --git a/loginutils/login.c b/loginutils/login.c index 46766c551..b1367327b 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -463,7 +463,7 @@ static void checkutmp(int picky) | |||
463 | static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED) | 463 | static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED) |
464 | { | 464 | { |
465 | time_t t_tmp = (time_t)utent.ut_time; | 465 | time_t t_tmp = (time_t)utent.ut_time; |
466 | 466 | ||
467 | utent.ut_type = USER_PROCESS; | 467 | utent.ut_type = USER_PROCESS; |
468 | strncpy(utent.ut_user, name, sizeof utent.ut_user); | 468 | strncpy(utent.ut_user, name, sizeof utent.ut_user); |
469 | time(&t_tmp); | 469 | time(&t_tmp); |
@@ -472,10 +472,10 @@ static void setutmp(const char *name, const char *line ATTRIBUTE_UNUSED) | |||
472 | pututline(&utent); | 472 | pututline(&utent); |
473 | endutent(); | 473 | endutent(); |
474 | #ifdef CONFIG_FEATURE_WTMP | 474 | #ifdef CONFIG_FEATURE_WTMP |
475 | if (access(_PATH_WTMP, R_OK|W_OK) == -1) { | 475 | if (access(bb_path_wtmp_file, R_OK|W_OK) == -1) { |
476 | close(creat(_PATH_WTMP, 0664)); | 476 | close(creat(bb_path_wtmp_file, 0664)); |
477 | } | 477 | } |
478 | updwtmp(_PATH_WTMP, &utent); | 478 | updwtmp(bb_path_wtmp_file, &utent); |
479 | #endif | 479 | #endif |
480 | } | 480 | } |
481 | #endif /* CONFIG_FEATURE_UTMP */ | 481 | #endif /* CONFIG_FEATURE_UTMP */ |