From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx> Signed-off-by: Ruediger Meier <ruediger.meier@xxxxxxxxxxx> --- 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 73c1b29..5917126 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 05fb082..a5e8507 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 dbf499e..0f114a5 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -28,7 +28,6 @@ #include <utmp.h> #include <getopt.h> #include <time.h> -#include <sys/file.h> #include <sys/socket.h> #include <langinfo.h> #include <grp.h> @@ -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 197f67f..7274afa 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 2c9ec55..d5cdad8 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), -- 1.8.5.6 -- To unsubscribe from this list: send the line "unsubscribe util-linux" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html