diff options
author | Ruediger Meier | 2016-12-01 09:52:11 +0100 |
---|---|---|
committer | Karel Zak | 2016-12-07 12:35:24 +0100 |
commit | b4b919fe5e1fc1d346fa6315748d0e0709d02096 (patch) | |
tree | e5eba9e27c382d608ab4c93edc1892d88d84e876 /login-utils/utmpdump.c | |
parent | agetty: remove obsolete HAVE_UPDWTMP fallback (diff) | |
download | kernel-qcow2-util-linux-b4b919fe5e1fc1d346fa6315748d0e0709d02096.tar.gz kernel-qcow2-util-linux-b4b919fe5e1fc1d346fa6315748d0e0709d02096.tar.xz kernel-qcow2-util-linux-b4b919fe5e1fc1d346fa6315748d0e0709d02096.zip |
login-utils: switch to utmpx.h
Now the build will fail on many non-Linux systems because
utmpx.h is available everywhere but we still use non-POSIX
features. We'll fix this next commit.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'login-utils/utmpdump.c')
-rw-r--r-- | login-utils/utmpdump.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/login-utils/utmpdump.c b/login-utils/utmpdump.c index 4a85afa7d..fd90b5e10 100644 --- a/login-utils/utmpdump.c +++ b/login-utils/utmpdump.c @@ -28,7 +28,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <utmp.h> +#include <utmpx.h> #include <time.h> #include <ctype.h> #include <getopt.h> @@ -87,7 +87,7 @@ static void xcleanse(char *s, int len) *s = '?'; } -static void print_utline(struct utmp *ut, FILE *out) +static void print_utline(struct utmpx *ut, FILE *out) { const char *addr_string; char buffer[INET6_ADDRSTRLEN]; @@ -129,7 +129,7 @@ static void roll_file(const char *filename, off_t *size, FILE *out) { FILE *in; struct stat st; - struct utmp ut; + struct utmpx ut; off_t pos; if (!(in = fopen(filename, "r"))) @@ -207,7 +207,7 @@ static int follow_by_inotify(FILE *in, const char *filename, FILE *out) static FILE *dump(FILE *in, const char *filename, int follow, FILE *out) { - struct utmp ut; + struct utmpx ut; if (follow) ignore_result( fseek(in, -10 * sizeof(ut), SEEK_END) ); @@ -265,7 +265,7 @@ static int gettok(char *line, char *dest, int size, int eatspace) static void undump(FILE *in, FILE *out) { - struct utmp ut; + struct utmpx ut; char s_addr[INET6_ADDRSTRLEN + 1], s_time[29], *linestart, *line; int count = 0; |