diff options
author | Ruediger Meier | 2016-12-01 09:52:10 +0100 |
---|---|---|
committer | Karel Zak | 2016-12-07 12:35:24 +0100 |
commit | 81580f79fa4b96b24a7db67815e7ffa7d3e2d42c (patch) | |
tree | 7824683ffefe186b18f570c4131151b324d802a4 /term-utils/agetty.c | |
parent | login: re-add lastlog.h header (diff) | |
download | kernel-qcow2-util-linux-81580f79fa4b96b24a7db67815e7ffa7d3e2d42c.tar.gz kernel-qcow2-util-linux-81580f79fa4b96b24a7db67815e7ffa7d3e2d42c.tar.xz kernel-qcow2-util-linux-81580f79fa4b96b24a7db67815e7ffa7d3e2d42c.zip |
agetty: remove obsolete HAVE_UPDWTMP fallback
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r-- | term-utils/agetty.c | 21 |
1 files changed, 1 insertions, 20 deletions
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 <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 */ |