Oops. Some ut_time stuff slipped through the cracks. These turned out

to be non-fatal due to stack alignment roundups.
This commit is contained in:
Peter Wemm 2002-11-17 23:46:45 +00:00
parent 904f1b77cc
commit f316609eb4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107030
3 changed files with 6 additions and 3 deletions

View File

@ -48,6 +48,7 @@ static char sccsid[] = "@(#)logout.c 8.1 (Berkeley) 6/4/93";
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <timeconv.h>
#include <libutil.h>
typedef struct utmp UTMP;
@ -68,7 +69,7 @@ logout(line)
continue;
bzero(ut.ut_name, UT_NAMESIZE);
bzero(ut.ut_host, UT_HOSTSIZE);
(void)time(&ut.ut_time);
ut.ut_time = _time_to_time32(time(NULL));
(void)lseek(fd, -(off_t)sizeof(UTMP), L_INCR);
(void)write(fd, &ut, sizeof(UTMP));
rval = 1;

View File

@ -50,6 +50,7 @@ static char sccsid[] = "@(#)logwtmp.c 8.1 (Berkeley) 6/4/93";
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <timeconv.h>
#include <unistd.h>
#include <utmp.h>
@ -102,7 +103,7 @@ logwtmp(line, name, host)
(void) strncpy(ut.ut_line, line, sizeof(ut.ut_line));
(void) strncpy(ut.ut_name, name, sizeof(ut.ut_name));
(void) strncpy(ut.ut_host, host, sizeof(ut.ut_host));
(void) time(&ut.ut_time);
ut.ut_time = _time_to_time32(time(NULL));
if (write(fd, (char *)&ut, sizeof(struct utmp)) !=
sizeof(struct utmp))
(void) ftruncate(fd, buf.st_size);

View File

@ -47,6 +47,7 @@ static const char rcsid[] =
#include <fcntl.h>
#include <time.h>
#include <timeconv.h>
#include <netdb.h>
#include <utmp.h>
#include <unistd.h>
@ -82,7 +83,7 @@ ftpd_logwtmp(line, name, addr)
(void)strncpy(ut.ut_line, line, sizeof(ut.ut_line));
(void)strncpy(ut.ut_name, name, sizeof(ut.ut_name));
(void)strncpy(ut.ut_host, host, sizeof(ut.ut_host));
(void)time(&ut.ut_time);
ut.ut_time = _time_to_time32(time(NULL));
if (write(fd, &ut, sizeof(struct utmp)) !=
sizeof(struct utmp))
(void)ftruncate(fd, buf.st_size);