From 62d85035895152c8232052dcfb1bbd3b549b7df9 Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Sun, 1 Jun 2008 10:10:22 +0000 Subject: - use ut_user rather than ut_name (Cristian Ionescu-Idbohrn) - use ut_tv.tv_sec rather than ut_time (me) - shrink halt a little bit (me): halt_main 464 433 -31 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-31) Total: -31 bytes --- loginutils/getty.c | 2 +- loginutils/login.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'loginutils') diff --git a/loginutils/getty.c b/loginutils/getty.c index ae183a62b..13a8c0c6c 100644 --- a/loginutils/getty.c +++ b/loginutils/getty.c @@ -605,7 +605,7 @@ static void update_utmp(const char *line, char *fakehost) safe_strncpy(ut.ut_line, line, sizeof(ut.ut_line)); if (fakehost) safe_strncpy(ut.ut_host, fakehost, sizeof(ut.ut_host)); - ut.ut_time = time(NULL); + ut.ut_tv.tv_sec = time(NULL); ut.ut_type = LOGIN_PROCESS; ut.ut_pid = mypid; diff --git a/loginutils/login.c b/loginutils/login.c index 900a7c042..d9a2f8a41 100644 --- a/loginutils/login.c +++ b/loginutils/login.c @@ -80,7 +80,7 @@ static void read_or_build_utent(struct utmp *utptr, int picky) * remotely meaningful by skipping "tty"... */ strncpy(utptr->ut_id, short_tty + 3, sizeof(utptr->ut_id)); strncpy(utptr->ut_user, "LOGIN", sizeof(utptr->ut_user)); - utptr->ut_time = time(NULL); + utptr->ut_tv.tv_sec = time(NULL); } if (!picky) /* root login */ memset(utptr->ut_host, 0, sizeof(utptr->ut_host)); @@ -96,7 +96,7 @@ static void write_utent(struct utmp *utptr, const char *username) { utptr->ut_type = USER_PROCESS; strncpy(utptr->ut_user, username, sizeof(utptr->ut_user)); - utptr->ut_time = time(NULL); + utptr->ut_tv.tv_sec = time(NULL); /* other fields already filled in by read_or_build_utent above */ setutent(); pututline(utptr); -- cgit v1.2.3