summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorSami Kerola2013-08-29 08:46:46 +0200
committerSami Kerola2013-08-29 19:14:10 +0200
commitcfa7fe890b09693ed503da7516977402cbbe13ed (patch)
tree209ef3d4676d62c36b59b62a33b06b37c9a5b8bf /term-utils/agetty.c
parentlast: tell verbally system is still running (diff)
downloadkernel-qcow2-util-linux-cfa7fe890b09693ed503da7516977402cbbe13ed.tar.gz
kernel-qcow2-util-linux-cfa7fe890b09693ed503da7516977402cbbe13ed.tar.xz
kernel-qcow2-util-linux-cfa7fe890b09693ed503da7516977402cbbe13ed.zip
last, utmpdump, agetty, wall, write: avoid compatibility hacks
In include/bits/utmp.h the ut_user and ut_time macros are marked with comment they are backwards compatibility hacks. It is probably best to avoid use of these macros where ever possible. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 4cd8675cb..af1e520db 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -849,7 +849,11 @@ static void update_utmp(struct options *op)
if (fakehost)
strncpy(ut.ut_host, fakehost, sizeof(ut.ut_host));
time(&t);
+#if defined(_HAVE_UT_TV)
+ ut.ut_tv.tv_sec = t;
+#else
ut.ut_time = t;
+#endif
ut.ut_type = LOGIN_PROCESS;
ut.ut_pid = pid;
ut.ut_session = sid;