diff options
author | peter <peter@FreeBSD.org> | 2002-11-15 22:42:00 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-11-15 22:42:00 +0000 |
commit | 97526c738c4cd08d52cb022605460e34b2f0b80f (patch) | |
tree | 414badc6420598c8e62302e330f16ee827afd3eb /usr.sbin | |
parent | c841be9bcbd974616aaa3b10b66a62d927ea1f88 (diff) | |
download | FreeBSD-src-97526c738c4cd08d52cb022605460e34b2f0b80f.zip FreeBSD-src-97526c738c4cd08d52cb022605460e34b2f0b80f.tar.gz |
utmp.ut_time and lastlog.ll_time are explicitly int32_t rather than
time_t. Deal with the possibility that time_t != int32_t. This boils
down to this sort of thing:
- time(&ut.ut_time);
+ ut.ut_time = time(NULL);
and similar for ctime(3) etc. I've kept it minimal for the stuff
that may need to be portable (or 3rd party code), but used Matt's time32
stuff for cases where that isn't as much of a concern.
Approved by: re (jhb)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/physical.c | 2 | ||||
-rw-r--r-- | usr.sbin/pppd/auth.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c index 29ea189..bff1198 100644 --- a/usr.sbin/ppp/physical.c +++ b/usr.sbin/ppp/physical.c @@ -916,7 +916,7 @@ physical_Login(struct physical *p, const char *name) char *colon; memset(&ut, 0, sizeof ut); - time(&ut.ut_time); + ut.ut_time = time(NULL); strncpy(ut.ut_name, name, sizeof ut.ut_name); if (p->handler && (p->handler->type == TCP_DEVICE || p->handler->type == UDP_DEVICE)) { diff --git a/usr.sbin/pppd/auth.c b/usr.sbin/pppd/auth.c index b2d43f8..6d2d737 100644 --- a/usr.sbin/pppd/auth.c +++ b/usr.sbin/pppd/auth.c @@ -995,7 +995,7 @@ plogin(user, passwd, msg, msglen) #endif memset((void *)&utmp, 0, sizeof(utmp)); - (void)time(&utmp.ut_time); + utmp.ut_time = time(NULL); (void)strncpy(utmp.ut_name, user, sizeof(utmp.ut_name)); (void)strncpy(utmp.ut_host, ":PPP", sizeof(utmp.ut_host)); (void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line)); |