Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Jan 2010 21:12:30 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r202718 - head/usr.bin/getent
Message-ID:  <201001202112.o0KLCUQp019223@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001202112.o0KLCUQp019223>