svn commit: r202718 - head/usr.bin/getent
Ed Schouten
ed at FreeBSD.org
Wed Jan 20 21:12:30 UTC 2010
Author: ed
Date: Wed Jan 20 21:12:30 2010
New Revision: 202718
URL: http://svn.freebsd.org/changeset/base/202718
Log:
Also print UNIX timestamps in getent utmpx output.
Modified:
head/usr.bin/getent/getent.c
Modified: head/usr.bin/getent/getent.c
==============================================================================
--- head/usr.bin/getent/getent.c Wed Jan 20 20:33:10 2010 (r202717)
+++ head/usr.bin/getent/getent.c Wed Jan 20 21:12:30 2010 (r202718)
@@ -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:
More information about the svn-src-all
mailing list