summaryrefslogtreecommitdiffstats
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-03-21 20:32:20 +0000
committerache <ache@FreeBSD.org>2001-03-21 20:32:20 +0000
commit313dba18c965663c3c879ee9e864c56532665a36 (patch)
treed4963fa918c5a27b3578752cfd11bc84ee309fb1 /usr.bin/systat
parentc17cf08845067d0467a5f8a184516297f55ff3b1 (diff)
downloadFreeBSD-src-313dba18c965663c3c879ee9e864c56532665a36.zip
FreeBSD-src-313dba18c965663c3c879ee9e864c56532665a36.tar.gz
Don't attempt to parse %c
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/vmstat.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index beb8e3c..f9bdc17 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -58,6 +58,7 @@ static const char rcsid[] =
#include <ctype.h>
#include <err.h>
#include <errno.h>
+#include <langinfo.h>
#include <nlist.h>
#include <paths.h>
#include <signal.h>
@@ -256,11 +257,15 @@ fetchkre()
{
time_t now;
struct tm *tp;
+ static int d_first = -1;
+
+ if (d_first < 0)
+ d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
time(&now);
tp = localtime(&now);
- (void) strftime(buf, sizeof(buf), "%c", tp);
- buf[16] = '\0';
+ (void) strftime(buf, sizeof(buf),
+ d_first ? "%e %b %R" : "%b %e %R", tp);
getinfo(&s, state);
}
OpenPOWER on IntegriCloud