summaryrefslogtreecommitdiffstats
path: root/bsd-login.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-05-17 22:53:33 +1000
committerDamien Miller <djm@mindrot.org>2000-05-17 22:53:33 +1000
commit615f939ebb48fdde404aae705057202512731331 (patch)
treee07b9fd90a8f8cb58b4b687919bb849b97fe6fc9 /bsd-login.c
parentdcb6ecd1b3b25b6909296ff0546ca6b18d0c19d3 (diff)
- Several patches from SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp>
- INSTALL typo and URL fix - Makefile fix - Solaris fixes - Checking for ssize_t and memmove. Based on patch from SAKAI Kiyotaka <ksakai@kso.netwk.ntt-at.co.jp>
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 910f9ff9..6a80928e 100644
--- a/bsd-login.c
+++ b/bsd-login.c
@@ -73,6 +73,7 @@ struct utmp * utp;
int t = 0;
struct utmp * u;
+#ifdef HAVE_TYPE_IN_UTMP
setutent();
while((u = getutent()) != NULL) {
@@ -91,6 +92,7 @@ struct utmp * utp;
}
endutent();
+#endif
return(-1);
}
@@ -128,6 +130,7 @@ login(utp)
/* If no tty was found... */
if (tty == -1) {
/* ... append it to utmp on login */
+#ifdef HAVE_TYPE_IN_UTMP
if (utp->ut_type == USER_PROCESS) {
if ((fd = open(_PATH_UTMP, O_WRONLY|O_APPEND, 0)) >= 0) {
(void)write(fd, utp, sizeof(struct utmp));
@@ -138,6 +141,7 @@ login(utp)
/* Between login and logout */
log("No tty slot found at logout");
}
+#endif
} else {
/* Otherwise, tty was found - update at its location */
#if defined(HAVE_HOST_IN_UTMP)