diff options
author | Ruediger Meier <ruediger.meier@ga-group.nl> | 2016-12-01 09:52:10 +0100 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2016-12-07 12:35:24 +0100 |
commit | 81580f79fa4b96b24a7db67815e7ffa7d3e2d42c (patch) | |
tree | 7824683ffefe186b18f570c4131151b324d802a4 | |
parent | 6578ced75c1314b7b49644bd0324194e9849d935 (diff) | |
download | util-linux-81580f79fa4b96b24a7db67815e7ffa7d3e2d42c.tar.gz |
agetty: remove obsolete HAVE_UPDWTMP fallback
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | include/pathnames.h | 2 | ||||
-rw-r--r-- | term-utils/agetty.c | 21 | ||||
-rw-r--r-- | tests/expected/paths/built-in | 1 | ||||
-rw-r--r-- | tests/helpers/test_pathnames.c | 1 |
5 files changed, 1 insertions, 25 deletions
diff --git a/configure.ac b/configure.ac index 73c1b29e4d..5917126ecf 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 05fb082ea2..a5e8507e01 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 dbf499ef57..0f114a5321 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 197f67fe25..7274afa18f 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 2c9ec55011..d5cdad829b 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), |