aboutsummaryrefslogtreecommitdiff
path: root/loginutils/getty.c
diff options
context:
space:
mode:
authorvapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-07-01 01:04:32 +0000
committervapier <vapier@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-07-01 01:04:32 +0000
commitce7992948b559cbc4ac9d815adbeb3b53c4f27a2 (patch)
tree132237fb52e98c8d72570d7ee2728f3e299383de /loginutils/getty.c
parentac6d18e54ca537f9a26e5ca65e1b1c0faf88d7ad (diff)
downloadbusybox-w32-ce7992948b559cbc4ac9d815adbeb3b53c4f27a2.tar.gz
busybox-w32-ce7992948b559cbc4ac9d815adbeb3b53c4f27a2.tar.bz2
busybox-w32-ce7992948b559cbc4ac9d815adbeb3b53c4f27a2.zip
Patch by jonlar in Bug 312 to split the U_W_TMP feature into sep UTMP and WTMP options
git-svn-id: svn://busybox.net/trunk/busybox@10679 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 3dd6258c5..9950988f4 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -47,7 +47,7 @@
47 47
48#ifdef LOGIN_PROCESS /* defined in System V utmp.h */ 48#ifdef LOGIN_PROCESS /* defined in System V utmp.h */
49#define SYSV_STYLE /* select System V style getty */ 49#define SYSV_STYLE /* select System V style getty */
50#ifdef CONFIG_FEATURE_U_W_TMP 50#ifdef CONFIG_FEATURE_WTMP
51extern void updwtmp(const char *filename, const struct utmp *ut); 51extern void updwtmp(const char *filename, const struct utmp *ut);
52#endif 52#endif
53#endif /* LOGIN_PROCESS */ 53#endif /* LOGIN_PROCESS */
@@ -231,7 +231,7 @@ static int caps_lock(const char *s);
231static int bcode(char *s); 231static int bcode(char *s);
232static void error(const char *fmt, ...) __attribute__ ((noreturn)); 232static void error(const char *fmt, ...) __attribute__ ((noreturn));
233 233
234#ifdef CONFIG_FEATURE_U_W_TMP 234#ifdef CONFIG_FEATURE_UTMP
235static void update_utmp(char *line); 235static void update_utmp(char *line);
236#endif 236#endif
237 237
@@ -289,7 +289,7 @@ int getty_main(int argc, char **argv)
289 289
290 290
291#ifdef SYSV_STYLE 291#ifdef SYSV_STYLE
292#ifdef CONFIG_FEATURE_U_W_TMP 292#ifdef CONFIG_FEATURE_UTMP
293 update_utmp(options.tty); 293 update_utmp(options.tty);
294#endif 294#endif
295#endif 295#endif
@@ -482,7 +482,7 @@ static void parse_speeds(struct options *op, char *arg)
482} 482}
483 483
484#ifdef SYSV_STYLE 484#ifdef SYSV_STYLE
485#ifdef CONFIG_FEATURE_U_W_TMP 485#ifdef CONFIG_FEATURE_UTMP
486 486
487/* update_utmp - update our utmp entry */ 487/* update_utmp - update our utmp entry */
488static void update_utmp(char *line) 488static void update_utmp(char *line)
@@ -533,15 +533,14 @@ static void update_utmp(char *line)
533 pututline(&ut); 533 pututline(&ut);
534 endutent(); 534 endutent();
535 535
536 { 536#ifdef CONFIG_FEATURE_WTMP
537 if (access(_PATH_WTMP, R_OK|W_OK) == -1) { 537 if (access(_PATH_WTMP, R_OK|W_OK) == -1)
538 close(creat(_PATH_WTMP, 0664)); 538 close(creat(_PATH_WTMP, 0664));
539 } 539 updwtmp(_PATH_WTMP, &ut);
540 updwtmp(_PATH_WTMP, &ut); 540#endif
541 }
542} 541}
543 542
544#endif /* CONFIG_FEATURE_U_W_TMP */ 543#endif /* CONFIG_FEATURE_UTMP */
545#endif /* SYSV_STYLE */ 544#endif /* SYSV_STYLE */
546 545
547/* open_tty - set up tty as standard { input, output, error } */ 546/* open_tty - set up tty as standard { input, output, error } */