summaryrefslogtreecommitdiff
path: root/loginutils/getty.c
diff options
context:
space:
mode:
authorMike Frysinger2005-07-01 01:04:32 +0000
committerMike Frysinger2005-07-01 01:04:32 +0000
commit8deb686d2e07ab812887a1a43a00ce5035c2b590 (patch)
tree132237fb52e98c8d72570d7ee2728f3e299383de /loginutils/getty.c
parenta87bb6080925177b0c09416a6b4e213bd9450042 (diff)
downloadbusybox-8deb686d2e07ab812887a1a43a00ce5035c2b590.zip
busybox-8deb686d2e07ab812887a1a43a00ce5035c2b590.tar.gz
Patch by jonlar in Bug 312 to split the U_W_TMP feature into sep UTMP and WTMP options
Diffstat (limited to 'loginutils/getty.c')
-rw-r--r--loginutils/getty.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 3dd6258..9950988 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -47,7 +47,7 @@
#ifdef LOGIN_PROCESS /* defined in System V utmp.h */
#define SYSV_STYLE /* select System V style getty */
-#ifdef CONFIG_FEATURE_U_W_TMP
+#ifdef CONFIG_FEATURE_WTMP
extern void updwtmp(const char *filename, const struct utmp *ut);
#endif
#endif /* LOGIN_PROCESS */
@@ -231,7 +231,7 @@ static int caps_lock(const char *s);
static int bcode(char *s);
static void error(const char *fmt, ...) __attribute__ ((noreturn));
-#ifdef CONFIG_FEATURE_U_W_TMP
+#ifdef CONFIG_FEATURE_UTMP
static void update_utmp(char *line);
#endif
@@ -289,7 +289,7 @@ int getty_main(int argc, char **argv)
#ifdef SYSV_STYLE
-#ifdef CONFIG_FEATURE_U_W_TMP
+#ifdef CONFIG_FEATURE_UTMP
update_utmp(options.tty);
#endif
#endif
@@ -482,7 +482,7 @@ static void parse_speeds(struct options *op, char *arg)
}
#ifdef SYSV_STYLE
-#ifdef CONFIG_FEATURE_U_W_TMP
+#ifdef CONFIG_FEATURE_UTMP
/* update_utmp - update our utmp entry */
static void update_utmp(char *line)
@@ -533,15 +533,14 @@ static void update_utmp(char *line)
pututline(&ut);
endutent();
- {
- if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
- close(creat(_PATH_WTMP, 0664));
- }
- updwtmp(_PATH_WTMP, &ut);
- }
+#ifdef CONFIG_FEATURE_WTMP
+ if (access(_PATH_WTMP, R_OK|W_OK) == -1)
+ close(creat(_PATH_WTMP, 0664));
+ updwtmp(_PATH_WTMP, &ut);
+#endif
}
-#endif /* CONFIG_FEATURE_U_W_TMP */
+#endif /* CONFIG_FEATURE_UTMP */
#endif /* SYSV_STYLE */
/* open_tty - set up tty as standard { input, output, error } */