| Always use 24-hour time format in w(1) and uptime(1). |
| |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/usr.bin/w/extern.h freebsd-10.4/usr.bin/w/extern.h |
| --- /var/archive3/public/freebsd-releng-10.4-src/usr.bin/w/extern.h 2017-09-29 08:21:22.000000000 +0800 |
| +++ freebsd-10.4/usr.bin/w/extern.h 2019-08-18 10:08:10.224073934 +0800 |
| @@ -30,8 +30,6 @@ |
| * $FreeBSD: releng/10.4/usr.bin/w/extern.h 243183 2012-11-17 16:47:05Z ed $ |
| */ |
| |
| -extern int use_ampm; |
| - |
| struct kinfo_proc; |
| int pr_attime(time_t *, time_t *); |
| int pr_idle(time_t); |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/usr.bin/w/pr_time.c freebsd-10.4/usr.bin/w/pr_time.c |
| --- /var/archive3/public/freebsd-releng-10.4-src/usr.bin/w/pr_time.c 2017-09-29 08:21:22.000000000 +0800 |
| +++ freebsd-10.4/usr.bin/w/pr_time.c 2019-08-18 10:11:02.922053165 +0800 |
| @@ -71,12 +71,12 @@ |
| tm.tm_year != tp.tm_year) { |
| /* The line below does not take DST into consideration */ |
| /* else if (*now / 86400 != *started / 86400) { */ |
| - fmt = use_ampm ? L"%a%I%p" : L"%a%H"; |
| + fmt = L"%a%H"; |
| } |
| |
| - /* Default is hh:mm{am,pm}. */ |
| + /* Default is hh:mm. */ |
| else { |
| - fmt = use_ampm ? L"%l:%M%p" : L"%k:%M"; |
| + fmt = L"%k:%M"; |
| } |
| |
| (void)wcsftime(buf, sizeof(buf), fmt, &tp); |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/archive3/public/freebsd-releng-10.4-src/usr.bin/w/w.c freebsd-10.4/usr.bin/w/w.c |
| --- /var/archive3/public/freebsd-releng-10.4-src/usr.bin/w/w.c 2017-09-29 08:21:22.000000000 +0800 |
| +++ freebsd-10.4/usr.bin/w/w.c 2019-08-18 10:08:10.236066240 +0800 |
| @@ -95,7 +95,6 @@ |
| static int nflag; /* true if -n flag: don't convert addrs */ |
| static int dflag; /* true if -d flag: output debug info */ |
| static int sortidle; /* sort by idle time */ |
| -int use_ampm; /* use AM/PM time */ |
| static int use_comma; /* use comma as floats separator */ |
| static char **sel_users; /* login array of particular users selected */ |
| |
| @@ -140,7 +139,6 @@ |
| char *dot; |
| |
| (void)setlocale(LC_ALL, ""); |
| - use_ampm = (*nl_langinfo(T_FMT_AMPM) != '\0'); |
| use_comma = (*nl_langinfo(RADIXCHAR) != ','); |
| |
| /* Are we w(1) or uptime(1)? */ |
| @@ -432,7 +430,7 @@ |
| * Print time of day. |
| */ |
| if (strftime(buf, sizeof(buf), |
| - use_ampm ? "%l:%M%p" : "%k:%M", localtime(nowp)) != 0) |
| + "%k:%M", localtime(nowp)) != 0) |
| (void)printf("%s ", buf); |
| /* |
| * Print how long system has been up. |