summaryrefslogtreecommitdiff
path: root/bsd-login.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-login.c')
-rw-r--r--bsd-login.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/bsd-login.c b/bsd-login.c
index d81e46914..eccb29ee4 100644
--- a/bsd-login.c
+++ b/bsd-login.c
@@ -65,24 +65,24 @@ login(utp)
65 struct utmp *utp; 65 struct utmp *utp;
66#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */ 66#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
67{ 67{
68#if defined(HAVE_HOST_IN_UTMP)
68 struct utmp old_ut; 69 struct utmp old_ut;
70#endif
69#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) 71#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
70 struct utmpx *old_utx; 72 struct utmpx *old_utx;
71#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */ 73#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
72 register int fd; 74 register int fd;
73 int tty; 75 int tty;
74 76
75#ifndef UT_LINESIZE
76# define UT_LINESIZE (sizeof(old_ut.ut_line))
77# define UT_NAMESIZE (sizeof(old_ut.ut_name))
78# ifdef HAVE_HOST_IN_UTMP
79# define UT_HOSTSIZE (sizeof(old_ut.ut_host))
80# endif
81#endif
82
83 tty = ttyslot(); 77 tty = ttyslot();
84 if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) { 78 if (tty > 0 && (fd = open(_PATH_UTMP, O_RDWR|O_CREAT, 0644)) >= 0) {
79
85#if defined(HAVE_HOST_IN_UTMP) 80#if defined(HAVE_HOST_IN_UTMP)
81# ifndef UT_LINESIZE
82# define UT_LINESIZE (sizeof(old_ut.ut_line))
83# define UT_NAMESIZE (sizeof(old_ut.ut_name))
84# define UT_HOSTSIZE (sizeof(old_ut.ut_host))
85# endif
86 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET); 86 (void)lseek(fd, (off_t)(tty * sizeof(struct utmp)), SEEK_SET);
87 /* 87 /*
88 * Prevent luser from zero'ing out ut_host. 88 * Prevent luser from zero'ing out ut_host.