From 81580f79fa4b96b24a7db67815e7ffa7d3e2d42c Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Thu, 1 Dec 2016 09:52:10 +0100 Subject: agetty: remove obsolete HAVE_UPDWTMP fallback Signed-off-by: Ruediger Meier --- configure.ac | 1 - include/pathnames.h | 2 -- term-utils/agetty.c | 21 +-------------------- tests/expected/paths/built-in | 1 - tests/helpers/test_pathnames.c | 1 - 5 files changed, 1 insertion(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac index 73c1b29e4..5917126ec 100644 --- a/configure.ac +++ b/configure.ac @@ -412,7 +412,6 @@ AC_CHECK_FUNCS([ \ strnlen \ sysconf \ sysinfo \ - updwtmp \ usleep \ warn \ warnx \ diff --git a/include/pathnames.h b/include/pathnames.h index 05fb082ea..a5e8507e0 100644 --- a/include/pathnames.h +++ b/include/pathnames.h @@ -35,8 +35,6 @@ # define _PATH_DEFPATH_ROOT "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" #endif -#define _PATH_WTMPLOCK "/etc/wtmplock" - #define _PATH_HUSHLOGIN ".hushlogin" #define _PATH_HUSHLOGINS "/etc/hushlogins" diff --git a/term-utils/agetty.c b/term-utils/agetty.c index dbf499ef5..0f114a532 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -951,25 +950,7 @@ static void update_utmp(struct options *op) pututline(&ut); endutent(); - { -#ifdef HAVE_UPDWTMP - updwtmp(_PATH_WTMP, &ut); -#else - int ut_fd; - int lf; - - if ((lf = open(_PATH_WTMPLOCK, O_CREAT | O_WRONLY, 0660)) >= 0) { - flock(lf, LOCK_EX); - if ((ut_fd = - open(_PATH_WTMP, O_APPEND | O_WRONLY)) >= 0) { - write_all(ut_fd, &ut, sizeof(ut)); - close(ut_fd); - } - flock(lf, LOCK_UN); - close(lf); - } -#endif /* HAVE_UPDWTMP */ - } + updwtmp(_PATH_WTMP, &ut); } #endif /* SYSV_STYLE */ diff --git a/tests/expected/paths/built-in b/tests/expected/paths/built-in index 197f67fe2..7274afa18 100644 --- a/tests/expected/paths/built-in +++ b/tests/expected/paths/built-in @@ -1,7 +1,6 @@ _PATH_DEFPATH /usr/local/bin:/bin:/usr/bin _PATH_DEFPATH_ROOT /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin _PATH_DEV_LOOP /dev/loop - _PATH_WTMPLOCK /etc/wtmplock _PATH_HUSHLOGIN .hushlogin _PATH_MAILDIR /var/mail _PATH_MOTDFILE /etc/motd diff --git a/tests/helpers/test_pathnames.c b/tests/helpers/test_pathnames.c index 2c9ec5501..d5cdad829 100644 --- a/tests/helpers/test_pathnames.c +++ b/tests/helpers/test_pathnames.c @@ -34,7 +34,6 @@ struct hlpPath paths[] = DEF_HLPPATH(_PATH_DEFPATH), DEF_HLPPATH(_PATH_DEFPATH_ROOT), DEF_HLPPATH(_PATH_DEV_LOOP), - DEF_HLPPATH(_PATH_WTMPLOCK), DEF_HLPPATH(_PATH_HUSHLOGIN), DEF_HLPPATH(_PATH_MAILDIR), DEF_HLPPATH(_PATH_MOTDFILE), -- cgit v1.2.3-55-g7522