aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorvodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-10-15 10:23:55 +0000
committervodz <vodz@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-10-15 10:23:55 +0000
commit247a3694036baa952f6dee076b04b7a58ca7df59 (patch)
tree5fc98f67e92bb2eca75d33940a4f8698bb216f3a /loginutils
parent1b47ba10db00a05de229d503090f5f36a1de552b (diff)
downloadbusybox-w32-247a3694036baa952f6dee076b04b7a58ca7df59.tar.gz
busybox-w32-247a3694036baa952f6dee076b04b7a58ca7df59.tar.bz2
busybox-w32-247a3694036baa952f6dee076b04b7a58ca7df59.zip
common BUFSIZ BSS buffer, small reduce code, data and bss
git-svn-id: svn://busybox.net/trunk/busybox@11867 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c19
-rw-r--r--loginutils/sulogin.c8
2 files changed, 10 insertions, 17 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index db9a150e0..e8643ef93 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -113,15 +113,6 @@ extern void updwtmp(const char *filename, const struct utmp *ut);
113#endif 113#endif
114 114
115 /* 115 /*
116 * This program tries to not use the standard-i/o library. This keeps the
117 * executable small on systems that do not have shared libraries (System V
118 * Release <3).
119 */
120#ifndef BUFSIZ
121#define BUFSIZ 1024
122#endif
123
124 /*
125 * When multiple baud rates are specified on the command line, the first one 116 * When multiple baud rates are specified on the command line, the first one
126 * we will try is the first one specified. 117 * we will try is the first one specified.
127 */ 118 */
@@ -744,12 +735,12 @@ static void next_speed(struct termio *tp, struct options *op)
744/* return NULL on failure, logname on success */ 735/* return NULL on failure, logname on success */
745static char *get_logname(struct options *op, struct chardata *cp, struct termio *tp) 736static char *get_logname(struct options *op, struct chardata *cp, struct termio *tp)
746{ 737{
747 static char logname[BUFSIZ]; 738#define logname bb_common_bufsiz1
748 char *bp; 739 char *bp;
749 char c; /* input character, full eight bits */ 740 char c; /* input character, full eight bits */
750 char ascval; /* low 7 bits of input character */ 741 char ascval; /* low 7 bits of input character */
751 int bits; /* # of "1" bits per character */ 742 int bits; /* # of "1" bits per character */
752 int mask; /* mask with 1 bit up */ 743 int mask; /* mask with 1 bit up */
753 static char *erase[] = { /* backspace-space-backspace */ 744 static char *erase[] = { /* backspace-space-backspace */
754 "\010\040\010", /* space parity */ 745 "\010\040\010", /* space parity */
755 "\010\040\010", /* odd parity */ 746 "\010\040\010", /* odd parity */
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index a458b6ed7..4e689ad68 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -21,7 +21,7 @@
21#define SULOGIN_PROMPT "\nGive root password for system maintenance\n" \ 21#define SULOGIN_PROMPT "\nGive root password for system maintenance\n" \
22 "(or type Control-D for normal startup):" 22 "(or type Control-D for normal startup):"
23 23
24static const char *forbid[] = { 24static const char * const forbid[] = {
25 "ENV", 25 "ENV",
26 "BASH_ENV", 26 "BASH_ENV",
27 "HOME", 27 "HOME",
@@ -53,11 +53,13 @@ extern int sulogin_main(int argc, char **argv)
53 char *device = (char *) 0; 53 char *device = (char *) 0;
54 const char *name = "root"; 54 const char *name = "root";
55 int timeout = 0; 55 int timeout = 0;
56 static char pass[BUFSIZ]; 56
57#define pass bb_common_bufsiz1
58
57 struct passwd pwent; 59 struct passwd pwent;
58 struct passwd *pwd; 60 struct passwd *pwd;
59 time_t start, now; 61 time_t start, now;
60 const char **p; 62 const char * const *p;
61#ifdef CONFIG_FEATURE_SHADOWPASSWDS 63#ifdef CONFIG_FEATURE_SHADOWPASSWDS
62 struct spwd *spwd = NULL; 64 struct spwd *spwd = NULL;
63#endif /* CONFIG_FEATURE_SHADOWPASSWDS */ 65#endif /* CONFIG_FEATURE_SHADOWPASSWDS */