summaryrefslogtreecommitdiff
path: root/bsd-login.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-login.c')
-rw-r--r--bsd-login.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bsd-login.c b/bsd-login.c
index 910f9ff9f..6a80928e0 100644
--- a/bsd-login.c
+++ b/bsd-login.c
@@ -73,6 +73,7 @@ struct utmp * utp;
73 int t = 0; 73 int t = 0;
74 struct utmp * u; 74 struct utmp * u;
75 75
76#ifdef HAVE_TYPE_IN_UTMP
76 setutent(); 77 setutent();
77 78
78 while((u = getutent()) != NULL) { 79 while((u = getutent()) != NULL) {
@@ -91,6 +92,7 @@ struct utmp * utp;
91 } 92 }
92 93
93 endutent(); 94 endutent();
95#endif
94 return(-1); 96 return(-1);
95} 97}
96 98
@@ -128,6 +130,7 @@ login(utp)
128 /* If no tty was found... */ 130 /* If no tty was found... */
129 if (tty == -1) { 131 if (tty == -1) {
130 /* ... append it to utmp on login */ 132 /* ... append it to utmp on login */
133#ifdef HAVE_TYPE_IN_UTMP
131 if (utp->ut_type == USER_PROCESS) { 134 if (utp->ut_type == USER_PROCESS) {
132 if ((fd = open(_PATH_UTMP, O_WRONLY|O_APPEND, 0)) >= 0) { 135 if ((fd = open(_PATH_UTMP, O_WRONLY|O_APPEND, 0)) >= 0) {
133 (void)write(fd, utp, sizeof(struct utmp)); 136 (void)write(fd, utp, sizeof(struct utmp));
@@ -138,6 +141,7 @@ login(utp)
138 /* Between login and logout */ 141 /* Between login and logout */
139 log("No tty slot found at logout"); 142 log("No tty slot found at logout");
140 } 143 }
144#endif
141 } else { 145 } else {
142 /* Otherwise, tty was found - update at its location */ 146 /* Otherwise, tty was found - update at its location */
143#if defined(HAVE_HOST_IN_UTMP) 147#if defined(HAVE_HOST_IN_UTMP)