diff options
author | Karel Zak | 2006-12-07 00:26:14 +0100 |
---|---|---|
committer | Karel Zak | 2006-12-07 00:26:14 +0100 |
commit | d03dd60840f0a08464d5266539ad356aefe24b03 (patch) | |
tree | 0a9ad240a7a88eb6b11b152974a7a51a0df79b75 /login-utils/login.c | |
parent | Imported from util-linux-2.12pre tarball. (diff) | |
download | kernel-qcow2-util-linux-d03dd60840f0a08464d5266539ad356aefe24b03.tar.gz kernel-qcow2-util-linux-d03dd60840f0a08464d5266539ad356aefe24b03.tar.xz kernel-qcow2-util-linux-d03dd60840f0a08464d5266539ad356aefe24b03.zip |
Imported from util-linux-2.12a tarball.
Diffstat (limited to 'login-utils/login.c')
-rw-r--r-- | login-utils/login.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/login-utils/login.c b/login-utils/login.c index da9b72fde..3b1bfa56e 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -906,9 +906,8 @@ Michael Riepe <michael@stud.uni-hannover.de> if (utp == NULL) { setutent(); ut.ut_type = LOGIN_PROCESS; - strncpy(ut.ut_id, tty_number, sizeof(ut.ut_id)); strncpy(ut.ut_line, tty_name, sizeof(ut.ut_line)); - utp = getutid(&ut); + utp = getutline(&ut); } if (utp) { @@ -1363,15 +1362,17 @@ dolastlog(int quiet) { if (!quiet) { if (read(fd, (char *)&ll, sizeof(ll)) == sizeof(ll) && ll.ll_time != 0) { - printf(_("Last login: %.*s "), - 24-5, (char *)ctime(&ll.ll_time)); + time_t ll_time = (time_t) ll.ll_time; + + printf(_("Last login: %.*s "), + 24-5, ctime(&ll_time)); - if (*ll.ll_host != '\0') - printf(_("from %.*s\n"), - (int)sizeof(ll.ll_host), ll.ll_host); - else - printf(_("on %.*s\n"), - (int)sizeof(ll.ll_line), ll.ll_line); + if (*ll.ll_host != '\0') + printf(_("from %.*s\n"), + (int)sizeof(ll.ll_host), ll.ll_host); + else + printf(_("on %.*s\n"), + (int)sizeof(ll.ll_line), ll.ll_line); } lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), SEEK_SET); } |