| Always use 24-hour time format in w(1) and uptime(1). |
| |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-src/usr/src/usr.bin/w/extern.h freebsd-10.3/usr/src/usr.bin/w/extern.h |
| --- /var/tmp/freebsd-src/usr/src/usr.bin/w/extern.h 2016-03-25 09:10:07.000000000 +0800 |
| +++ freebsd-10.3/usr/src/usr.bin/w/extern.h 2018-11-05 19:22:58.461831571 +0800 |
| @@ -30,8 +30,6 @@ |
| * $FreeBSD: releng/10.3/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/tmp/freebsd-src/usr/src/usr.bin/w/pr_time.c freebsd-10.3/usr/src/usr.bin/w/pr_time.c |
| --- /var/tmp/freebsd-src/usr/src/usr.bin/w/pr_time.c 2016-03-25 09:10:07.000000000 +0800 |
| +++ freebsd-10.3/usr/src/usr.bin/w/pr_time.c 2018-11-05 19:23:18.034837481 +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}. */ |
| else { |
| - fmt = use_ampm ? L"%l:%M%p" : L"%k:%M"; |
| + fmt = L"%k:%M"; |
| } |
| |
| (void)wcsftime(buf, sizeof(buf), fmt, &tp); |
| Only in freebsd-10.3/usr/src/usr.bin/w: w |
| diff -ru --exclude-from freebsd-src-diff-exclude-names /var/tmp/freebsd-src/usr/src/usr.bin/w/w.c freebsd-10.3/usr/src/usr.bin/w/w.c |
| --- /var/tmp/freebsd-src/usr/src/usr.bin/w/w.c 2016-03-25 09:10:07.000000000 +0800 |
| +++ freebsd-10.3/usr/src/usr.bin/w/w.c 2018-11-05 19:23:24.800828474 +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. |