summaryrefslogtreecommitdiff
path: root/libutil/logwtmp.c
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-03-29 04:50:56 -0500
committerWaldemar Brodkorb <wbx@openadk.org>2015-03-29 04:50:56 -0500
commitcd5f92704e1e17bbc0c15d197f3bc236c7dc9bf2 (patch)
tree1400302b543e4528aedea5d72731983559cfcf36 /libutil/logwtmp.c
parentad2bffbf1926051ef333f9899344f6bddf2c03cf (diff)
parent24946289317ea23bb0d1814cca0a499a905f7d6f (diff)
merge uClibc git master
Diffstat (limited to 'libutil/logwtmp.c')
-rw-r--r--libutil/logwtmp.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/libutil/logwtmp.c b/libutil/logwtmp.c
index 2a6f28a48..99b772fc4 100644
--- a/libutil/logwtmp.c
+++ b/libutil/logwtmp.c
@@ -9,13 +9,13 @@
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
-#include <utmp.h>
#include <fcntl.h>
#include <sys/file.h>
+#include "internal/utmp.h"
void logwtmp(const char *line, const char *name, const char *host)
{
- struct utmp lutmp;
+ struct UT lutmp;
memset(&lutmp, 0, sizeof(lutmp));
lutmp.ut_type = (name && *name) ? USER_PROCESS : DEAD_PROCESS;
@@ -23,7 +23,7 @@ void logwtmp(const char *line, const char *name, const char *host)
strncpy(lutmp.ut_line, line, sizeof(lutmp.ut_line)-1);
strncpy(lutmp.ut_name, name, sizeof(lutmp.ut_name)-1);
strncpy(lutmp.ut_host, host, sizeof(lutmp.ut_host)-1);
-#if !defined __WORDSIZE_COMPAT32 || __WORDSIZE_COMPAT32 == 0
+#if !defined __WORDSIZE_TIME64_COMPAT32
gettimeofday(&lutmp.ut_tv, NULL);
#else
{
@@ -36,20 +36,3 @@ void logwtmp(const char *line, const char *name, const char *host)
updwtmp(_PATH_WTMP, &lutmp);
}
-
-#if 0
-/* This is enabled in uClibc/libc/misc/utmp/wtent.c */
-void updwtmp(const char *wtmp_file, const struct utmp *lutmp)
-{
- int fd;
-
- fd = open(wtmp_file, O_APPEND | O_WRONLY);
- if (fd >= 0) {
- if (lockf(fd, F_LOCK, 0) == 0) {
- write(fd, lutmp, sizeof(*lutmp));
- lockf(fd, F_ULOCK, 0);
- close(fd);
- }
- }
-}
-#endif