diff options
author | Ed Schouten <ed@FreeBSD.org> | 2010-01-20 21:12:30 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2010-01-20 21:12:30 +0000 |
commit | f9503ae0eef9bfb355d09fe6fdd14984c2ac7fa6 (patch) | |
tree | 7ae58fe3ac18d2caea8a88d4306622effbc3166a | |
parent | 8b72ee05e7598b516fdbe5a7d2bed1bf6842cad9 (diff) | |
download | getent-darwin-f9503ae0eef9bfb355d09fe6fdd14984c2ac7fa6.tar.gz getent-darwin-f9503ae0eef9bfb355d09fe6fdd14984c2ac7fa6.tar.zst getent-darwin-f9503ae0eef9bfb355d09fe6fdd14984c2ac7fa6.zip |
Also print UNIX timestamps in getent utmpx output.
-rw-r--r-- | getent.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -55,8 +55,9 @@ __FBSDID("$FreeBSD$"); #include <limits.h> #include <netdb.h> #include <pwd.h> -#include <stdio.h> #include <stdarg.h> +#include <stdint.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -583,7 +584,9 @@ utmpxprint(const struct utmpx *ut) if (ut->ut_type == EMPTY) return; - printf("[%.24s] ", ctime(&ut->ut_tv.tv_sec)); + printf("[%jd.%06u -- %.24s] ", + (intmax_t)ut->ut_tv.tv_sec, (unsigned int)ut->ut_tv.tv_usec, + ctime(&ut->ut_tv.tv_sec)); switch (ut->ut_type) { case BOOT_TIME: |