diff options
author | Sami Kerola | 2013-08-29 08:46:46 +0200 |
---|---|---|
committer | Sami Kerola | 2013-08-29 19:14:10 +0200 |
commit | cfa7fe890b09693ed503da7516977402cbbe13ed (patch) | |
tree | 209ef3d4676d62c36b59b62a33b06b37c9a5b8bf /term-utils/write.c | |
parent | last: tell verbally system is still running (diff) | |
download | kernel-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/write.c')
-rw-r--r-- | term-utils/write.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/term-utils/write.c b/term-utils/write.c index 173869465..f5ca34108 100644 --- a/term-utils/write.c +++ b/term-utils/write.c @@ -201,7 +201,7 @@ int utmp_chk(char *user, char *tty) while ((uptr = getutent())) { memcpy(&u, uptr, sizeof(u)); - if (strncmp(user, u.ut_name, sizeof(u.ut_name)) == 0 && + if (strncmp(user, u.ut_user, sizeof(u.ut_user)) == 0 && strncmp(tty, u.ut_line, sizeof(u.ut_line)) == 0) { res = 0; break; @@ -239,7 +239,7 @@ void search_utmp(char *user, char *tty, char *mytty, uid_t myuid) user_is_me = 0; while ((uptr = getutent())) { memcpy(&u, uptr, sizeof(u)); - if (strncmp(user, u.ut_name, sizeof(u.ut_name)) == 0) { + if (strncmp(user, u.ut_user, sizeof(u.ut_user)) == 0) { ++nloggedttys; strncpy(atty, u.ut_line, sizeof(u.ut_line)); atty[sizeof(u.ut_line)] = '\0'; |