* [v2 PATCH 0/5] Pull Request and v2 changes
@ 2017-11-12 15:22 J William Piggott
2017-11-12 15:23 ` [v2 PATCH 1/5] hwclock: add iso-8601 overflow check J William Piggott
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: J William Piggott @ 2017-11-12 15:22 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
v2 Changes:
* Apply Karel's changes for ISO_TIMESTAMP initializations
* Fix last.c breakage caused by adding ISO timezone colon
* New PATCH 5/5 to fix various tests broken by ISO timezone colon
* Fix ISO format flags in timeutils.c main()
A little help please:
* test lsipc and rfkill (changes to ISO timestamps), I couldn't test them.
* check the new PATCH 5/5, as I'm not familiar with the tests system
Note: the tests passed with and without the change in tests/ts/utmp/subsec
The following changes since commit 82524a1379c02bff0d061ffffae7398543218d33:
nsenter: revert changes committed by accident (2017-11-10 14:02:51 +0100)
are available in the git repository at:
git@github.com:jwpi/util-linux.git 170925
for you to fetch changes up to 948e8d4349a7f83be1b6b3e94932eb4b8d6946d0:
tests: adjust for ISO timezone colon use (2017-11-12 09:08:43 -0500)
----------------------------------------------------------------
J William Piggott (5):
hwclock: add iso-8601 overflow check
lib/timeutils: ISO_8601_BUFSIZ too small
lib/timeutils: add get_gmtoff()
lib/timeutils: add common ISO timestamp masks
tests: adjust for ISO timezone colon use
include/timeutils.h | 27 ++++++---
lib/timeutils.c | 98 +++++++++++++++++++++++++++------
login-utils/last.c | 6 +-
login-utils/lslogins.c | 5 +-
login-utils/utmpdump.c | 4 +-
misc-utils/uuidparse.c | 12 +---
sys-utils/dmesg.c | 4 +-
sys-utils/hwclock.c | 25 ++++-----
sys-utils/lsipc.c | 2 +-
sys-utils/rfkill.c | 10 +---
term-utils/script.c | 8 +--
tests/expected/dmesg/indentation | 10 ++--
tests/expected/script/options-append | 8 +--
tests/expected/script/options-force | 8 +--
tests/expected/script/options-quiet | 8 +--
tests/expected/script/options-return | 16 +++---
tests/expected/utmp/last-nodns | 30 +++++-----
tests/expected/utmp/utmpdump-subsecond | 6 +-
tests/expected/utmp/utmpdump-totxt | 20 +++----
tests/expected/utmp/utmpdump-totxt-ipv6 | 4 +-
tests/expected/uuid/uuidparse | 2 +-
tests/ts/utmp/subsec | 6 +-
tests/ts/utmp/txt-a | 38 ++++++-------
tests/ts/utmp/txt-b | 20 +++----
tests/ts/utmp/txt-ipv6 | 4 +-
25 files changed, 214 insertions(+), 167 deletions(-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v2 PATCH 1/5] hwclock: add iso-8601 overflow check
2017-11-12 15:22 [v2 PATCH 0/5] Pull Request and v2 changes J William Piggott
@ 2017-11-12 15:23 ` J William Piggott
2017-11-12 15:24 ` [v2 PATCH 2/5] lib/timeutils: ISO_8601_BUFSIZ too small J William Piggott
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: J William Piggott @ 2017-11-12 15:23 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
hwclock wasn't testing for strtimeval_iso() truncation:
/sbin/hwclock --utc --noadjfile --predict --date '7982 years'; echo $?
9999-09-25 19:33:01.000000-0400
0
/sbin/hwclock --utc --noadjfile --predict --date '7983 years'; echo $?
10000-09-25 19:33:10.000000-
0
Patched:
./hwclock --utc --noadjfile --predict --date '7982 years'; echo $?
9999-09-25 19:22:15.000000-0400
0
./hwclock --utc --noadjfile --predict --date '7983 years'; echo $?
hwclock: iso-8601 format truncated
1
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
sys-utils/hwclock.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 36b6204b0..c2c20812c 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -551,15 +551,19 @@ set_hardware_clock_exact(const struct hwclock_control *ctl,
set_hardware_clock(ctl, newhwtime);
}
-static void
+static int
display_time(struct timeval hwctime)
{
char buf[ISO_8601_BUFSIZ];
- strtimeval_iso(&hwctime, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_DOTUSEC|
+ if (strtimeval_iso(&hwctime, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_DOTUSEC|
ISO_8601_TIMEZONE|ISO_8601_SPACE,
- buf, sizeof(buf));
+ buf, sizeof(buf))) {
+ warnx(_("iso-8601 format overflow"));
+ return EXIT_FAILURE;
+ }
printf("%s\n", buf);
+ return EXIT_SUCCESS;
}
/*
@@ -931,8 +935,7 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time,
printf(_ ("Target date: %ld\n"), set_time);
printf(_ ("Predicted RTC: %ld\n"), hclocktime.tv_sec);
}
- display_time(hclocktime);
- return EXIT_SUCCESS;
+ return display_time(hclocktime);
}
if (ctl->systz)
@@ -978,7 +981,7 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time,
time_inc(hclocktime, time_diff(startup_time, read_time));
}
if (ctl->show || ctl->get) {
- display_time(startup_hclocktime);
+ return display_time(startup_hclocktime);
} else if (ctl->set) {
set_hardware_clock_exact(ctl, set_time, startup_time);
if (!ctl->noadjfile)
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [v2 PATCH 2/5] lib/timeutils: ISO_8601_BUFSIZ too small
2017-11-12 15:22 [v2 PATCH 0/5] Pull Request and v2 changes J William Piggott
2017-11-12 15:23 ` [v2 PATCH 1/5] hwclock: add iso-8601 overflow check J William Piggott
@ 2017-11-12 15:24 ` J William Piggott
2017-11-12 15:25 ` [v2 PATCH 3/5] lib/timeutils: add get_gmtoff() J William Piggott
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: J William Piggott @ 2017-11-12 15:24 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
Although iso-8601 specifies years as 4 digits, it allows
them to be wider.
The current POSIX year width is limited by 'int tm_year'
at 10 digits plus a negative sign.
That, and the possibility of nanosecond time makes the
widest POSIX iso-8601 time 41 characters. Plus the \0
string terminator yields a buffer size of 42.
Before truncated output:
/sbin/hwclock --utc --noadjfile --predict --date '-2147483765 years'
-2147481748-09-25 20:29:45.0000
Patched:
./hwclock --utc --noadjfile --predict --date '-2147483765 years'
-2147481748-09-25 20:17:21.000000-0456
./hwclock --utc --noadjfile --predict --date '-2147483766 years'
hwclock: invalid date '-2147483766 years'
Comparable to coreutils 'date' command:
date -Ins --date '-2147483765 years'
-2147481748-09-25T19:49:31,578899297-0456
date -Ins --date '-2147483766 years'
date: invalid date '-2147483766 years'
The 'date' output illustrates the full 41 character POSIX iso-8601
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
include/timeutils.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/timeutils.h b/include/timeutils.h
index 874f853b7..edd42f7fe 100644
--- a/include/timeutils.h
+++ b/include/timeutils.h
@@ -65,7 +65,7 @@ enum {
ISO_8601_GMTIME = (1 << 7)
};
-#define ISO_8601_BUFSIZ 32
+#define ISO_8601_BUFSIZ 42
int strtimeval_iso(struct timeval *tv, int flags, char *buf, size_t bufsz);
int strtm_iso(struct tm *tm, int flags, char *buf, size_t bufsz);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [v2 PATCH 3/5] lib/timeutils: add get_gmtoff()
2017-11-12 15:22 [v2 PATCH 0/5] Pull Request and v2 changes J William Piggott
2017-11-12 15:23 ` [v2 PATCH 1/5] hwclock: add iso-8601 overflow check J William Piggott
2017-11-12 15:24 ` [v2 PATCH 2/5] lib/timeutils: ISO_8601_BUFSIZ too small J William Piggott
@ 2017-11-12 15:25 ` J William Piggott
2017-11-12 15:26 ` [v2 PATCH 4/5] lib/timeutils: add common ISO timestamp masks J William Piggott
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: J William Piggott @ 2017-11-12 15:25 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
This new function returns the GMT offset relative to its
argument. It is used in this patch to fix two bugs:
1) On platforms that the tm struct excludes tm_gmtoff,
hwclock assumes a one hour DST offset. This can cause
an incorrect kernel timezone setting. For example:
Master branch tested with tm_gmtoff illustrates the correct offset:
$ TZ="Australia/Lord_Howe" hwclock --hctosys --test | grep settimeofday
Calling settimeofday(1507494204.192398, -660)
Master branch tested without tm_gmtoff has an incorrect offset:
$ TZ="Australia/Lord_Howe" hwclock --hctosys --test | grep settimeofday
Calling settimeofday(1507494249.193852, -690)
Patched tested without tm_gmtoff has the correct offset:
$ TZ="Australia/Lord_Howe" hwclock --hctosys --test | grep settimeofday
Calling settimeofday(1507494260.194208, -660)
2) ISO 8601 'extended' format requires all time elements
to use a colon (:).
Current invalid ISO 8601:
$ hwclock
2017-10-08 16:25:17.895462-0400
Patched:
$ hwclock
2017-10-08 16:25:34.141895-04:00
Also required by this change:
login-utils/last.c: increase ISO out_len and in_len by one to
accommodate the addition of the timezone colon.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
include/timeutils.h | 1 +
lib/timeutils.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++--
login-utils/last.c | 4 ++--
sys-utils/hwclock.c | 8 +------
4 files changed, 70 insertions(+), 11 deletions(-)
diff --git a/include/timeutils.h b/include/timeutils.h
index edd42f7fe..e8a261462 100644
--- a/include/timeutils.h
+++ b/include/timeutils.h
@@ -53,6 +53,7 @@ typedef uint64_t nsec_t;
#define FORMAT_TIMESPAN_MAX 64
int parse_timestamp(const char *t, usec_t *usec);
+int get_gmtoff(const struct tm *tp);
/* flags for strxxx_iso() functions */
enum {
diff --git a/lib/timeutils.c b/lib/timeutils.c
index d38970c10..adc255c33 100644
--- a/lib/timeutils.c
+++ b/lib/timeutils.c
@@ -341,6 +341,65 @@ int parse_timestamp(const char *t, usec_t *usec)
return 0;
}
+/* Returns the difference in seconds between its argument and GMT. If if TP is
+ * invalid or no DST information is available default to UTC, that is, zero.
+ * tzset is called so, for example, 'TZ="UTC" hwclock' will work as expected.
+ * Derived from glibc/time/strftime_l.c
+ */
+int get_gmtoff(const struct tm *tp)
+{
+ if (tp->tm_isdst < 0)
+ return 0;
+
+#if HAVE_TM_GMTOFF
+ return tp->tm_gmtoff;
+#else
+ struct tm tm;
+ struct tm gtm;
+ struct tm ltm = *tp;
+ time_t lt;
+
+ tzset();
+ lt = mktime(<m);
+ /* Check if mktime returning -1 is an error or a valid time_t */
+ if (lt == (time_t) -1) {
+ if (! localtime_r(<, &tm)
+ || ((ltm.tm_sec ^ tm.tm_sec)
+ | (ltm.tm_min ^ tm.tm_min)
+ | (ltm.tm_hour ^ tm.tm_hour)
+ | (ltm.tm_mday ^ tm.tm_mday)
+ | (ltm.tm_mon ^ tm.tm_mon)
+ | (ltm.tm_year ^ tm.tm_year)))
+ return 0;
+ }
+
+ if (! gmtime_r(<, >m))
+ return 0;
+
+ /* Calculate the GMT offset, that is, the difference between the
+ * TP argument (ltm) and GMT (gtm).
+ *
+ * Compute intervening leap days correctly even if year is negative.
+ * Take care to avoid int overflow in leap day calculations, but it's OK
+ * to assume that A and B are close to each other.
+ */
+ int a4 = (ltm.tm_year >> 2) + (1900 >> 2) - ! (ltm.tm_year & 3);
+ int b4 = (gtm.tm_year >> 2) + (1900 >> 2) - ! (gtm.tm_year & 3);
+ int a100 = a4 / 25 - (a4 % 25 < 0);
+ int b100 = b4 / 25 - (b4 % 25 < 0);
+ int a400 = a100 >> 2;
+ int b400 = b100 >> 2;
+ int intervening_leap_days = (a4 - b4) - (a100 - b100) + (a400 - b400);
+
+ int years = ltm.tm_year - gtm.tm_year;
+ int days = (365 * years + intervening_leap_days
+ + (ltm.tm_yday - gtm.tm_yday));
+
+ return (60 * (60 * (24 * days + (ltm.tm_hour - gtm.tm_hour))
+ + (ltm.tm_min - gtm.tm_min)) + (ltm.tm_sec - gtm.tm_sec));
+#endif
+}
+
static int format_iso_time(struct tm *tm, suseconds_t usec, int flags, char *buf, size_t bufsz)
{
char *p = buf;
@@ -386,9 +445,14 @@ static int format_iso_time(struct tm *tm, suseconds_t usec, int flags, char *buf
p += len;
}
- if (flags & ISO_8601_TIMEZONE && strftime(p, bufsz, "%z", tm) <= 0)
+ if (flags & ISO_8601_TIMEZONE) {
+ int tmin = get_gmtoff(tm) / 60;
+ int zhour = tmin / 60;
+ int zmin = abs(tmin % 60);
+ len = snprintf(p, bufsz, "%+03d:%02d", zhour,zmin);
+ if (len < 0 || (size_t) len > bufsz)
return -1;
-
+ }
return 0;
}
diff --git a/login-utils/last.c b/login-utils/last.c
index f989836ba..f2e8f834e 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -145,8 +145,8 @@ static struct last_timefmt timefmts[] = {
},
[LAST_TIMEFTM_ISO8601] = {
.name = "iso",
- .in_len = 24,
- .out_len = 26,
+ .in_len = 25,
+ .out_len = 27,
.in_fmt = LAST_TIMEFTM_ISO8601,
.out_fmt = LAST_TIMEFTM_ISO8601
}
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index c2c20812c..3ac43efee 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -608,13 +608,7 @@ set_system_clock(const struct hwclock_control *ctl,
const struct timezone tz_utc = { 0 };
broken = localtime(&newtime.tv_sec);
-#ifdef HAVE_TM_GMTOFF
- minuteswest = -broken->tm_gmtoff / 60; /* GNU extension */
-#else
- minuteswest = timezone / 60;
- if (broken->tm_isdst)
- minuteswest -= 60;
-#endif
+ minuteswest = -get_gmtoff(broken) / 60;
if (ctl->debug) {
if (ctl->hctosys && !ctl->universal)
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [v2 PATCH 4/5] lib/timeutils: add common ISO timestamp masks
2017-11-12 15:22 [v2 PATCH 0/5] Pull Request and v2 changes J William Piggott
` (2 preceding siblings ...)
2017-11-12 15:25 ` [v2 PATCH 3/5] lib/timeutils: add get_gmtoff() J William Piggott
@ 2017-11-12 15:26 ` J William Piggott
2017-11-12 15:27 ` [v2 PATCH 5/5] tests: adjust for ISO timezone colon use J William Piggott
2017-11-13 15:51 ` [v2 PATCH 0/5] Pull Request and v2 changes Karel Zak
5 siblings, 0 replies; 7+ messages in thread
From: J William Piggott @ 2017-11-12 15:26 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
* Start the ISO format flags at bit 0 instead of bit 1.
* Remove unnecessary _8601 from ISO format flag names to
avoid line wrapping and to ease readability.
* ISO timestamps have date-time-timzone in common, so move
the TIMEZONE flag to bit 2 causing all timestamp masks
to have the first three bits set and the last four bits
as timestamp 'options'.
* Change the 'SPACE' flag to a 'T' flag, because it makes
the code and comments more concise.
* Add common ISO timestamp masks.
* Implement the ISO timestamp masks in all applicable code
using the strxxx_iso() functions.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
include/timeutils.h | 26 +++++++++++++++++---------
lib/timeutils.c | 32 +++++++++++++++-----------------
login-utils/last.c | 2 +-
login-utils/lslogins.c | 5 ++---
login-utils/utmpdump.c | 4 +---
misc-utils/uuidparse.c | 12 +++---------
sys-utils/dmesg.c | 4 +---
sys-utils/hwclock.c | 6 ++----
sys-utils/lsipc.c | 2 +-
sys-utils/rfkill.c | 10 +++-------
term-utils/script.c | 8 ++------
11 files changed, 48 insertions(+), 63 deletions(-)
diff --git a/include/timeutils.h b/include/timeutils.h
index e8a261462..230e6db5f 100644
--- a/include/timeutils.h
+++ b/include/timeutils.h
@@ -55,18 +55,26 @@ typedef uint64_t nsec_t;
int parse_timestamp(const char *t, usec_t *usec);
int get_gmtoff(const struct tm *tp);
-/* flags for strxxx_iso() functions */
+/* flags and masks for strxxx_iso() functions */
enum {
- ISO_8601_DATE = (1 << 1),
- ISO_8601_TIME = (1 << 2),
- ISO_8601_DOTUSEC = (1 << 3),
- ISO_8601_COMMAUSEC = (1 << 4),
- ISO_8601_TIMEZONE = (1 << 5),
- ISO_8601_SPACE = (1 << 6),
- ISO_8601_GMTIME = (1 << 7)
+ ISO_DATE = (1 << 0),
+ ISO_TIME = (1 << 1),
+ ISO_TIMEZONE = (1 << 2),
+ ISO_DOTUSEC = (1 << 3),
+ ISO_COMMAUSEC = (1 << 4),
+ ISO_T = (1 << 5),
+ ISO_GMTIME = (1 << 6),
+ ISO_TIMESTAMP = ISO_DATE | ISO_TIME | ISO_TIMEZONE,
+ ISO_TIMESTAMP_T = ISO_TIMESTAMP | ISO_T,
+ ISO_TIMESTAMP_DOT = ISO_TIMESTAMP | ISO_DOTUSEC,
+ ISO_TIMESTAMP_DOT_T = ISO_TIMESTAMP_DOT | ISO_T,
+ ISO_TIMESTAMP_COMMA = ISO_TIMESTAMP | ISO_COMMAUSEC,
+ ISO_TIMESTAMP_COMMA_T = ISO_TIMESTAMP_COMMA | ISO_T,
+ ISO_TIMESTAMP_COMMA_G = ISO_TIMESTAMP_COMMA | ISO_GMTIME,
+ ISO_TIMESTAMP_COMMA_GT = ISO_TIMESTAMP_COMMA_G | ISO_T
};
-#define ISO_8601_BUFSIZ 42
+#define ISO_BUFSIZ 42
int strtimeval_iso(struct timeval *tv, int flags, char *buf, size_t bufsz);
int strtm_iso(struct tm *tm, int flags, char *buf, size_t bufsz);
diff --git a/lib/timeutils.c b/lib/timeutils.c
index adc255c33..fdaa2d4a9 100644
--- a/lib/timeutils.c
+++ b/lib/timeutils.c
@@ -405,7 +405,7 @@ static int format_iso_time(struct tm *tm, suseconds_t usec, int flags, char *buf
char *p = buf;
int len;
- if (flags & ISO_8601_DATE) {
+ if (flags & ISO_DATE) {
len = snprintf(p, bufsz, "%4d-%.2d-%.2d", tm->tm_year + 1900,
tm->tm_mon + 1, tm->tm_mday);
if (len < 0 || (size_t) len > bufsz)
@@ -414,14 +414,14 @@ static int format_iso_time(struct tm *tm, suseconds_t usec, int flags, char *buf
p += len;
}
- if ((flags & ISO_8601_DATE) && (flags & ISO_8601_TIME)) {
+ if ((flags & ISO_DATE) && (flags & ISO_TIME)) {
if (bufsz < 1)
return -1;
- *p++ = (flags & ISO_8601_SPACE) ? ' ' : 'T';
+ *p++ = (flags & ISO_T) ? 'T' : ' ';
bufsz--;
}
- if (flags & ISO_8601_TIME) {
+ if (flags & ISO_TIME) {
len = snprintf(p, bufsz, "%02d:%02d:%02d", tm->tm_hour,
tm->tm_min, tm->tm_sec);
if (len < 0 || (size_t) len > bufsz)
@@ -430,14 +430,14 @@ static int format_iso_time(struct tm *tm, suseconds_t usec, int flags, char *buf
p += len;
}
- if (flags & ISO_8601_DOTUSEC) {
+ if (flags & ISO_DOTUSEC) {
len = snprintf(p, bufsz, ".%06ld", (long) usec);
if (len < 0 || (size_t) len > bufsz)
return -1;
bufsz -= len;
p += len;
- } else if (flags & ISO_8601_COMMAUSEC) {
+ } else if (flags & ISO_COMMAUSEC) {
len = snprintf(p, bufsz, ",%06ld", (long) usec);
if (len < 0 || (size_t) len > bufsz)
return -1;
@@ -445,7 +445,7 @@ static int format_iso_time(struct tm *tm, suseconds_t usec, int flags, char *buf
p += len;
}
- if (flags & ISO_8601_TIMEZONE) {
+ if (flags & ISO_TIMEZONE) {
int tmin = get_gmtoff(tm) / 60;
int zhour = tmin / 60;
int zmin = abs(tmin % 60);
@@ -461,7 +461,7 @@ int strtimeval_iso(struct timeval *tv, int flags, char *buf, size_t bufsz)
{
struct tm tm;
- if (flags & ISO_8601_GMTIME)
+ if (flags & ISO_GMTIME)
tm = *gmtime(&tv->tv_sec);
else
tm = *localtime(&tv->tv_sec);
@@ -479,7 +479,7 @@ int strtime_iso(const time_t *t, int flags, char *buf, size_t bufsz)
{
struct tm tm;
- if (flags & ISO_8601_GMTIME)
+ if (flags & ISO_GMTIME)
tm = *gmtime(t);
else
tm = *localtime(t);
@@ -548,7 +548,7 @@ time_t timegm(struct tm *tm)
int main(int argc, char *argv[])
{
struct timeval tv = { 0 };
- char buf[ISO_8601_BUFSIZ];
+ char buf[ISO_BUFSIZ];
if (argc < 2) {
fprintf(stderr, "usage: %s <time> [<usec>]\n", argv[0]);
@@ -559,19 +559,17 @@ int main(int argc, char *argv[])
if (argc == 3)
tv.tv_usec = strtos64_or_err(argv[2], "failed to parse <usec>");
- strtimeval_iso(&tv, ISO_8601_DATE, buf, sizeof(buf));
+ strtimeval_iso(&tv, ISO_DATE, buf, sizeof(buf));
printf("Date: '%s'\n", buf);
- strtimeval_iso(&tv, ISO_8601_TIME, buf, sizeof(buf));
+ strtimeval_iso(&tv, ISO_TIME, buf, sizeof(buf));
printf("Time: '%s'\n", buf);
- strtimeval_iso(&tv, ISO_8601_DATE | ISO_8601_TIME | ISO_8601_COMMAUSEC,
- buf, sizeof(buf));
+ strtimeval_iso(&tv, ISO_DATE | ISO_TIME | ISO_COMMAUSEC | ISO_T,
+ buf, sizeof(buf));
printf("Full: '%s'\n", buf);
- strtimeval_iso(&tv, ISO_8601_DATE | ISO_8601_TIME | ISO_8601_DOTUSEC |
- ISO_8601_TIMEZONE | ISO_8601_SPACE,
- buf, sizeof(buf));
+ strtimeval_iso(&tv, ISO_TIMESTAMP_DOT, buf, sizeof(buf));
printf("Zone: '%s'\n", buf);
return EXIT_SUCCESS;
diff --git a/login-utils/last.c b/login-utils/last.c
index f2e8f834e..80d77d20b 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -349,7 +349,7 @@ static int time_formatter(int fmt, char *dst, size_t dlen, time_t *when)
ret = rtrim_whitespace((unsigned char *) dst);
break;
case LAST_TIMEFTM_ISO8601:
- ret = strtime_iso(when, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_TIMEZONE, dst, dlen);
+ ret = strtime_iso(when, ISO_TIMESTAMP_T, dst, dlen);
break;
default:
abort();
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index 1042b9b41..51033b01b 100644
--- a/login-utils/lslogins.c
+++ b/login-utils/lslogins.c
@@ -333,11 +333,10 @@ static char *make_time(int mode, time_t time)
buf, sizeof(buf));
break;
case TIME_ISO:
- rc = strtime_iso(&time, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_TIMEZONE,
- buf, sizeof(buf));
+ rc = strtime_iso(&time, ISO_TIMESTAMP_T, buf, sizeof(buf));
break;
case TIME_ISO_SHORT:
- rc = strtime_iso(&time, ISO_8601_DATE, buf, sizeof(buf));
+ rc = strtime_iso(&time, ISO_DATE, buf, sizeof(buf));
break;
default:
errx(EXIT_FAILURE, _("unsupported time type"));
diff --git a/login-utils/utmpdump.c b/login-utils/utmpdump.c
index 00c44b8db..5cc87834a 100644
--- a/login-utils/utmpdump.c
+++ b/login-utils/utmpdump.c
@@ -102,9 +102,7 @@ static void print_utline(struct utmpx *ut, FILE *out)
tv.tv_sec = ut->ut_tv.tv_sec;
tv.tv_usec = ut->ut_tv.tv_usec;
- if (strtimeval_iso(&tv,
- ISO_8601_DATE | ISO_8601_TIME | ISO_8601_COMMAUSEC |
- ISO_8601_TIMEZONE | ISO_8601_GMTIME, time_string,
+ if (strtimeval_iso(&tv, ISO_TIMESTAMP_COMMA_GT, time_string,
sizeof(time_string)) != 0)
return;
cleanse(ut->ut_id);
diff --git a/misc-utils/uuidparse.c b/misc-utils/uuidparse.c
index 08ba33415..777f9db5e 100644
--- a/misc-utils/uuidparse.c
+++ b/misc-utils/uuidparse.c
@@ -224,17 +224,11 @@ static void fill_table_row(struct libscols_table *tb, char const *const uuid)
}
if (variant == UUID_VARIANT_DCE && type == 1) {
struct timeval tv;
- char date_buf[ISO_8601_BUFSIZ + 4];
+ char date_buf[ISO_BUFSIZ];
uuid_time(buf, &tv);
- strtimeval_iso(&tv,
- ISO_8601_DATE |
- ISO_8601_TIME |
- ISO_8601_COMMAUSEC |
- ISO_8601_TIMEZONE |
- ISO_8601_SPACE,
- date_buf,
- sizeof(date_buf));
+ strtimeval_iso(&tv, ISO_TIMESTAMP_COMMA,
+ date_buf, sizeof(date_buf));
str = xstrdup(date_buf);
}
break;
diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c
index 9fdc1d8a7..bdd50b474 100644
--- a/sys-utils/dmesg.c
+++ b/sys-utils/dmesg.c
@@ -840,9 +840,7 @@ static char *iso_8601_time(struct dmesg_control *ctl, struct dmesg_record *rec,
.tv_usec = rec->tv.tv_usec
};
- if (strtimeval_iso(&tv, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_COMMAUSEC|
- ISO_8601_TIMEZONE,
- buf, bufsz) != 0)
+ if (strtimeval_iso(&tv, ISO_TIMESTAMP_COMMA_T, buf, bufsz) != 0)
return NULL;
return buf;
diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c
index 3ac43efee..c93a5fd65 100644
--- a/sys-utils/hwclock.c
+++ b/sys-utils/hwclock.c
@@ -554,11 +554,9 @@ set_hardware_clock_exact(const struct hwclock_control *ctl,
static int
display_time(struct timeval hwctime)
{
- char buf[ISO_8601_BUFSIZ];
+ char buf[ISO_BUFSIZ];
- if (strtimeval_iso(&hwctime, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_DOTUSEC|
- ISO_8601_TIMEZONE|ISO_8601_SPACE,
- buf, sizeof(buf))) {
+ if (strtimeval_iso(&hwctime, ISO_TIMESTAMP_DOT, buf, sizeof(buf))) {
warnx(_("iso-8601 format overflow"));
return EXIT_FAILURE;
}
diff --git a/sys-utils/lsipc.c b/sys-utils/lsipc.c
index e99c861ab..4b3b0c92d 100644
--- a/sys-utils/lsipc.c
+++ b/sys-utils/lsipc.c
@@ -451,7 +451,7 @@ static char *make_time(int mode, time_t time)
strtime_short(&time, &now, 0, buf, sizeof(buf));
break;
case TIME_ISO:
- strtime_iso(&time, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_TIMEZONE, buf, sizeof(buf));
+ strtime_iso(&time, ISO_TIMESTAMP_T, buf, sizeof(buf));
break;
default:
errx(EXIT_FAILURE, _("unsupported time type"));
diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c
index c9559ef48..75804ad41 100644
--- a/sys-utils/rfkill.c
+++ b/sys-utils/rfkill.c
@@ -223,7 +223,7 @@ static int rfkill_event(void)
{
struct rfkill_event event;
struct timeval tv;
- char date_buf[ISO_8601_BUFSIZ];
+ char date_buf[ISO_BUFSIZ];
struct pollfd p;
int fd, n;
@@ -253,12 +253,8 @@ static int rfkill_event(void)
continue;
gettimeofday(&tv, NULL);
- strtimeval_iso(&tv,
- ISO_8601_DATE |
- ISO_8601_TIME |
- ISO_8601_COMMAUSEC |
- ISO_8601_TIMEZONE |
- ISO_8601_SPACE, date_buf, sizeof(date_buf));
+ strtimeval_iso(&tv, ISO_TIMESTAMP_COMMA, date_buf,
+ sizeof(date_buf));
printf("%s: idx %u type %u op %u soft %u hard %u\n",
date_buf,
event.idx, event.type, event.op, event.soft, event.hard);
diff --git a/term-utils/script.c b/term-utils/script.c
index cf63ab336..f991de14e 100644
--- a/term-utils/script.c
+++ b/term-utils/script.c
@@ -472,9 +472,7 @@ static void do_io(struct script_control *ctl)
if (ctl->typescriptfp) {
- strtime_iso(&tvec, ISO_8601_DATE | ISO_8601_TIME |
- ISO_8601_TIMEZONE | ISO_8601_SPACE,
- buf, sizeof(buf));
+ strtime_iso(&tvec, ISO_TIMESTAMP, buf, sizeof(buf));
fprintf(ctl->typescriptfp, _("Script started on %s\n"), buf);
}
gettime_monotonic(&ctl->oldtime);
@@ -546,9 +544,7 @@ static void do_io(struct script_control *ctl)
if (ctl->typescriptfp) {
tvec = script_time((time_t *)NULL);
- strtime_iso(&tvec, ISO_8601_DATE | ISO_8601_TIME |
- ISO_8601_TIMEZONE | ISO_8601_SPACE,
- buf, sizeof(buf));
+ strtime_iso(&tvec, ISO_TIMESTAMP, buf, sizeof(buf));
fprintf(ctl->typescriptfp, _("\nScript done on %s\n"), buf);
}
done(ctl);
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [v2 PATCH 5/5] tests: adjust for ISO timezone colon use
2017-11-12 15:22 [v2 PATCH 0/5] Pull Request and v2 changes J William Piggott
` (3 preceding siblings ...)
2017-11-12 15:26 ` [v2 PATCH 4/5] lib/timeutils: add common ISO timestamp masks J William Piggott
@ 2017-11-12 15:27 ` J William Piggott
2017-11-13 15:51 ` [v2 PATCH 0/5] Pull Request and v2 changes Karel Zak
5 siblings, 0 replies; 7+ messages in thread
From: J William Piggott @ 2017-11-12 15:27 UTC (permalink / raw)
To: Karel Zak; +Cc: util-linux
Fix several tests broken by adding a timezone colon in the
timeutils ISO format functions.
Signed-off-by: J William Piggott <elseifthen@gmx.com>
---
tests/expected/dmesg/indentation | 10 ++++-----
tests/expected/script/options-append | 8 +++----
tests/expected/script/options-force | 8 +++----
tests/expected/script/options-quiet | 8 +++----
tests/expected/script/options-return | 16 +++++++-------
tests/expected/utmp/last-nodns | 30 +++++++++++++-------------
tests/expected/utmp/utmpdump-subsecond | 6 +++---
tests/expected/utmp/utmpdump-totxt | 20 ++++++++---------
tests/expected/utmp/utmpdump-totxt-ipv6 | 4 ++--
tests/expected/uuid/uuidparse | 2 +-
tests/ts/utmp/subsec | 6 +++---
tests/ts/utmp/txt-a | 38 ++++++++++++++++-----------------
tests/ts/utmp/txt-b | 20 ++++++++---------
tests/ts/utmp/txt-ipv6 | 4 ++--
14 files changed, 90 insertions(+), 90 deletions(-)
diff --git a/tests/expected/dmesg/indentation b/tests/expected/dmesg/indentation
index 0d0b6e448..e1b2770d1 100644
--- a/tests/expected/dmesg/indentation
+++ b/tests/expected/dmesg/indentation
@@ -28,8 +28,8 @@ lines
[Fri Feb 13 23:31:32 2009] two
new
lines
-2009-02-13T23:31:31,000000+0000 new
- line
-2009-02-13T23:31:32,000000+0000 two
- new
- lines
+2009-02-13T23:31:31,000000+00:00 new
+ line
+2009-02-13T23:31:32,000000+00:00 two
+ new
+ lines
diff --git a/tests/expected/script/options-append b/tests/expected/script/options-append
index 3e8cdf81a..4e932554a 100644
--- a/tests/expected/script/options-append
+++ b/tests/expected/script/options-append
@@ -1,8 +1,8 @@
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
append1
-Script done on 2015-05-24 17:43:18+0000
-Script started on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
+Script started on 2015-05-24 17:43:18+00:00
append2
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
diff --git a/tests/expected/script/options-force b/tests/expected/script/options-force
index 4bfc7dc10..a0bc50bf3 100644
--- a/tests/expected/script/options-force
+++ b/tests/expected/script/options-force
@@ -2,13 +2,13 @@ test_script: output file `typescript' is a link
Use --force if you really want to use it.
Program not started.
1
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
with force
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
0
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
not typescript
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
0
diff --git a/tests/expected/script/options-quiet b/tests/expected/script/options-quiet
index 83b8a2ae8..cfb2a7e16 100644
--- a/tests/expected/script/options-quiet
+++ b/tests/expected/script/options-quiet
@@ -1,8 +1,8 @@
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
quiet1
-Script done on 2015-05-24 17:43:18+0000
-Script started on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
+Script started on 2015-05-24 17:43:18+00:00
quiet2
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
diff --git a/tests/expected/script/options-return b/tests/expected/script/options-return
index 4a3a8cfa4..f4c606a96 100644
--- a/tests/expected/script/options-return
+++ b/tests/expected/script/options-return
@@ -1,16 +1,16 @@
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
0
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
0
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
42
-Script started on 2015-05-24 17:43:18+0000
+Script started on 2015-05-24 17:43:18+00:00
-Script done on 2015-05-24 17:43:18+0000
+Script done on 2015-05-24 17:43:18+00:00
127
diff --git a/tests/expected/utmp/last-nodns b/tests/expected/utmp/last-nodns
index e92366266..5b9171de3 100644
--- a/tests/expected/utmp/last-nodns
+++ b/tests/expected/utmp/last-nodns
@@ -92,22 +92,22 @@ login foo six (01:00)
user_pro foo seven (01:00)
accounti foo nine (01:00)
~~~ iso-8601 time ~~~
-rick long never-gonna-logout 1970-01-01T00:00:00+0000 - 2038-01-19T03:14:07+0000 (24855+03:14)
-torvalds linux hobby 1991-08-26T00:57:08+0000 gone - no logout
-reboot system boot system-name 2013-08-28T18:00:00+0000 still running
-reboot system boot system-name 2013-08-28T16:00:00+0000 - 2013-08-28T17:00:00+0000 (01:00)
-IPv4 root dns-server 2013-08-28T13:00:00+0000 - 2013-08-28T14:00:00+0000 (01:00)
-nonvalid foo zero 2013-08-28T12:00:00+0000 - down (03:00)
-runlevel foo one 2013-08-28T11:00:00+0000 - 2013-08-28T12:00:00+0000 (01:00)
-sysboot foo two 2013-08-28T10:00:00+0000 - 2013-08-28T11:00:00+0000 (01:00)
-newtime foo three 2013-08-28T09:00:00+0000 - 2013-08-28T10:00:00+0000 (01:00)
-oldtime foo four 2013-08-28T08:00:00+0000 - 2013-08-28T09:00:00+0000 (01:00)
-init foo five 2013-08-28T07:00:00+0000 - 2013-08-28T08:00:00+0000 (01:00)
-login foo six 2013-08-28T06:00:00+0000 - 2013-08-28T07:00:00+0000 (01:00)
-user_process foo seven 2013-08-28T05:00:00+0000 - 2013-08-28T06:00:00+0000 (01:00)
-accounting foo nine 2013-08-28T03:00:00+0000 - 2013-08-28T04:00:00+0000 (01:00)
+rick long never-gonna-logout 1970-01-01T00:00:00+00:00 - 2038-01-19T03:14:07+00:00 (24855+03:14)
+torvalds linux hobby 1991-08-26T00:57:08+00:00 gone - no logout
+reboot system boot system-name 2013-08-28T18:00:00+00:00 still running
+reboot system boot system-name 2013-08-28T16:00:00+00:00 - 2013-08-28T17:00:00+00:00 (01:00)
+IPv4 root dns-server 2013-08-28T13:00:00+00:00 - 2013-08-28T14:00:00+00:00 (01:00)
+nonvalid foo zero 2013-08-28T12:00:00+00:00 - down (03:00)
+runlevel foo one 2013-08-28T11:00:00+00:00 - 2013-08-28T12:00:00+00:00 (01:00)
+sysboot foo two 2013-08-28T10:00:00+00:00 - 2013-08-28T11:00:00+00:00 (01:00)
+newtime foo three 2013-08-28T09:00:00+00:00 - 2013-08-28T10:00:00+00:00 (01:00)
+oldtime foo four 2013-08-28T08:00:00+00:00 - 2013-08-28T09:00:00+00:00 (01:00)
+init foo five 2013-08-28T07:00:00+00:00 - 2013-08-28T08:00:00+00:00 (01:00)
+login foo six 2013-08-28T06:00:00+00:00 - 2013-08-28T07:00:00+00:00 (01:00)
+user_process foo seven 2013-08-28T05:00:00+00:00 - 2013-08-28T06:00:00+00:00 (01:00)
+accounting foo nine 2013-08-28T03:00:00+00:00 - 2013-08-28T04:00:00+00:00 (01:00)
-wtmp-a begins 2013-08-28T03:00:00+0000
+wtmp-a begins 2013-08-28T03:00:00+00:00
~~~ since and until ~~~
oldtime foo four Wed Aug 28 08:00 gone - no logout
init foo five Wed Aug 28 07:00 - 08:00 (01:00)
diff --git a/tests/expected/utmp/utmpdump-subsecond b/tests/expected/utmp/utmpdump-subsecond
index 649ab7f8c..67d2cf859 100644
--- a/tests/expected/utmp/utmpdump-subsecond
+++ b/tests/expected/utmp/utmpdump-subsecond
@@ -1,4 +1,4 @@
last 9 is expected to disappear in conversion
-[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,123456+0000]
-[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,999999+0000]
-[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,12345678+0000]
+[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,123456+00:00]
+[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,999999+00:00]
+[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,12345678+00:00]
diff --git a/tests/expected/utmp/utmpdump-totxt b/tests/expected/utmp/utmpdump-totxt
index 5deefde60..f92927336 100644
--- a/tests/expected/utmp/utmpdump-totxt
+++ b/tests/expected/utmp/utmpdump-totxt
@@ -1,10 +1,10 @@
-[7] [17058] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:44:09,000000+0000]
-[7] [22098] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:49:17,000000+0000]
-[7] [24915] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T12:23:33,000000+0000]
-[8] [24915] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T12:24:49,000000+0000]
-[7] [30629] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T13:12:39,000000+0000]
-[8] [30629] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:19,000000+0000]
-[8] [22098] [ts/2] [kerolasa] [pts/2 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+0000]
-[8] [17058] [ts/1] [kerolasa] [pts/1 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+0000]
-[7] [31545] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T20:17:21,000000+0000]
-[7] [28496] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T21:09:39,000000+0000]
+[7] [17058] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:44:09,000000+00:00]
+[7] [22098] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:49:17,000000+00:00]
+[7] [24915] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T12:23:33,000000+00:00]
+[8] [24915] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T12:24:49,000000+00:00]
+[7] [30629] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T13:12:39,000000+00:00]
+[8] [30629] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:19,000000+00:00]
+[8] [22098] [ts/2] [kerolasa] [pts/2 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+00:00]
+[8] [17058] [ts/1] [kerolasa] [pts/1 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+00:00]
+[7] [31545] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T20:17:21,000000+00:00]
+[7] [28496] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T21:09:39,000000+00:00]
diff --git a/tests/expected/utmp/utmpdump-totxt-ipv6 b/tests/expected/utmp/utmpdump-totxt-ipv6
index 589414408..cceb411bf 100644
--- a/tests/expected/utmp/utmpdump-totxt-ipv6
+++ b/tests/expected/utmp/utmpdump-totxt-ipv6
@@ -1,2 +1,2 @@
-[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,000000+0000]
-[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,000000+0000]
+[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,000000+00:00]
+[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,000000+00:00]
diff --git a/tests/expected/uuid/uuidparse b/tests/expected/uuid/uuidparse
index c4959be8d..8b23a2548 100644
--- a/tests/expected/uuid/uuidparse
+++ b/tests/expected/uuid/uuidparse
@@ -26,6 +26,6 @@ UUID VARIANT TYPE TIME
00000000-0000-4000-f000-000000000000 other random
00000000-0000-5000-f000-000000000000 other sha1-based
00000000-0000-6000-f000-000000000000 other unknown
-9b274c46-544a-11e7-a972-00037f500001 DCE time-based 2017-06-18 17:21:46,544647+0000
+9b274c46-544a-11e7-a972-00037f500001 DCE time-based 2017-06-18 17:21:46,544647+00:00
invalid-input invalid invalid invalid
return value: 0
diff --git a/tests/ts/utmp/subsec b/tests/ts/utmp/subsec
index 4881e7cad..0fdff0577 100644
--- a/tests/ts/utmp/subsec
+++ b/tests/ts/utmp/subsec
@@ -1,3 +1,3 @@
-[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,123456+0000]
-[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,999999+0000]
-[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,123456789+0000]
+[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,123456+00:00]
+[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,999999+00:00]
+[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,123456789+00:00]
diff --git a/tests/ts/utmp/txt-a b/tests/ts/utmp/txt-a
index 8501daab0..47b6fc2fc 100644
--- a/tests/ts/utmp/txt-a
+++ b/tests/ts/utmp/txt-a
@@ -1,19 +1,19 @@
-[9] [00009] [ts/9] [accounting] [foo ] [nine ] [0.0.0.0 ] [2013-08-28T03:00:00,000000+0000]
-[8] [00008] [ts/8] [dead_process] [foo ] [eight ] [0.0.0.0 ] [2013-08-28T04:00:00,000000+0000]
-[7] [00007] [ts/7] [user_process] [foo ] [seven ] [0.0.0.0 ] [2013-08-28T05:00:00,000000+0000]
-[6] [00006] [ts/6] [login ] [foo ] [six ] [0.0.0.0 ] [2013-08-28T06:00:00,000000+0000]
-[5] [00005] [ts/5] [init ] [foo ] [five ] [0.0.0.0 ] [2013-08-28T07:00:00,000000+0000]
-[4] [00004] [ts/4] [oldtime ] [foo ] [four ] [0.0.0.0 ] [2013-08-28T08:00:00,000000+0000]
-[3] [00003] [ts/3] [newtime ] [foo ] [three ] [0.0.0.0 ] [2013-08-28T09:00:00,000000+0000]
-[2] [00002] [ts/2] [sysboot ] [foo ] [two ] [0.0.0.0 ] [2013-08-28T10:00:00,000000+0000]
-[1] [00001] [ts/1] [runlevel] [foo ] [one ] [0.0.0.0 ] [2013-08-28T11:00:00,000000+0000]
-[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,000000+0000]
-[7] [00010] [ipv4] [IPv4 ] [root ] [dns-server ] [198.41.0.4 ] [2013-08-28T13:00:00,000000+0000]
-[8] [00011] [ipv4] [IPv4 ] [root ] [dns-server ] [198.41.0.4 ] [2013-08-28T14:00:00,000000+0000]
-[1] [00012] [~~ ] [shutdown] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T15:00:00,000000+0000]
-[2] [00012] [~~ ] [reboot ] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T16:00:00,000000+0000]
-[1] [00012] [~~ ] [shutdown] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T17:00:00,000000+0000]
-[2] [00012] [~~ ] [reboot ] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T18:00:00,000000+0000]
-[7] [00013] [ts/1] [torvalds] [linux ] [hobby ] [128.214.205.14 ] [1991-08-26T00:57:08,000000+0000]
-[7] [00014] [long] [rick ] [long ] [never-gonna-logout ] [0.0.0.0 ] [1970-01-01T00:00:00,000000+0000]
-[8] [00014] [long] [rick ] [long ] [never-gonna-logout ] [0.0.0.0 ] [2038-01-19T03:14:07,000000+0000]
+[9] [00009] [ts/9] [accounting] [foo ] [nine ] [0.0.0.0 ] [2013-08-28T03:00:00,000000+00:00]
+[8] [00008] [ts/8] [dead_process] [foo ] [eight ] [0.0.0.0 ] [2013-08-28T04:00:00,000000+00:00]
+[7] [00007] [ts/7] [user_process] [foo ] [seven ] [0.0.0.0 ] [2013-08-28T05:00:00,000000+00:00]
+[6] [00006] [ts/6] [login ] [foo ] [six ] [0.0.0.0 ] [2013-08-28T06:00:00,000000+00:00]
+[5] [00005] [ts/5] [init ] [foo ] [five ] [0.0.0.0 ] [2013-08-28T07:00:00,000000+00:00]
+[4] [00004] [ts/4] [oldtime ] [foo ] [four ] [0.0.0.0 ] [2013-08-28T08:00:00,000000+00:00]
+[3] [00003] [ts/3] [newtime ] [foo ] [three ] [0.0.0.0 ] [2013-08-28T09:00:00,000000+00:00]
+[2] [00002] [ts/2] [sysboot ] [foo ] [two ] [0.0.0.0 ] [2013-08-28T10:00:00,000000+00:00]
+[1] [00001] [ts/1] [runlevel] [foo ] [one ] [0.0.0.0 ] [2013-08-28T11:00:00,000000+00:00]
+[0] [00000] [ts/0] [nonvalid] [foo ] [zero ] [0.0.0.0 ] [2013-08-28T12:00:00,000000+00:00]
+[7] [00010] [ipv4] [IPv4 ] [root ] [dns-server ] [198.41.0.4 ] [2013-08-28T13:00:00,000000+00:00]
+[8] [00011] [ipv4] [IPv4 ] [root ] [dns-server ] [198.41.0.4 ] [2013-08-28T14:00:00,000000+00:00]
+[1] [00012] [~~ ] [shutdown] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T15:00:00,000000+00:00]
+[2] [00012] [~~ ] [reboot ] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T16:00:00,000000+00:00]
+[1] [00012] [~~ ] [shutdown] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T17:00:00,000000+00:00]
+[2] [00012] [~~ ] [reboot ] [~ ] [system-name ] [0.0.0.0 ] [2013-08-28T18:00:00,000000+00:00]
+[7] [00013] [ts/1] [torvalds] [linux ] [hobby ] [128.214.205.14 ] [1991-08-26T00:57:08,000000+00:00]
+[7] [00014] [long] [rick ] [long ] [never-gonna-logout ] [0.0.0.0 ] [1970-01-01T00:00:00,000000+00:00]
+[8] [00014] [long] [rick ] [long ] [never-gonna-logout ] [0.0.0.0 ] [2038-01-19T03:14:07,000000+00:00]
diff --git a/tests/ts/utmp/txt-b b/tests/ts/utmp/txt-b
index 5deefde60..f92927336 100644
--- a/tests/ts/utmp/txt-b
+++ b/tests/ts/utmp/txt-b
@@ -1,10 +1,10 @@
-[7] [17058] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:44:09,000000+0000]
-[7] [22098] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:49:17,000000+0000]
-[7] [24915] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T12:23:33,000000+0000]
-[8] [24915] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T12:24:49,000000+0000]
-[7] [30629] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T13:12:39,000000+0000]
-[8] [30629] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:19,000000+0000]
-[8] [22098] [ts/2] [kerolasa] [pts/2 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+0000]
-[8] [17058] [ts/1] [kerolasa] [pts/1 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+0000]
-[7] [31545] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T20:17:21,000000+0000]
-[7] [28496] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T21:09:39,000000+0000]
+[7] [17058] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:44:09,000000+00:00]
+[7] [22098] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-16T23:49:17,000000+00:00]
+[7] [24915] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T12:23:33,000000+00:00]
+[8] [24915] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T12:24:49,000000+00:00]
+[7] [30629] [ts/3] [kerolasa] [pts/3 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T13:12:39,000000+00:00]
+[8] [30629] [ts/3] [kerolasa] [pts/3 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:19,000000+00:00]
+[8] [22098] [ts/2] [kerolasa] [pts/2 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+00:00]
+[8] [17058] [ts/1] [kerolasa] [pts/1 ] [ ] [0.0.0.0 ] [2013-01-17T13:42:48,000000+00:00]
+[7] [31545] [ts/1] [kerolasa] [pts/1 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T20:17:21,000000+00:00]
+[7] [28496] [ts/2] [kerolasa] [pts/2 ] [:0.0 ] [0.0.0.0 ] [2013-01-17T21:09:39,000000+00:00]
diff --git a/tests/ts/utmp/txt-ipv6 b/tests/ts/utmp/txt-ipv6
index 589414408..cceb411bf 100644
--- a/tests/ts/utmp/txt-ipv6
+++ b/tests/ts/utmp/txt-ipv6
@@ -1,2 +1,2 @@
-[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,000000+0000]
-[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,000000+0000]
+[7] [00010] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:30:40,000000+00:00]
+[8] [00011] [ipv6] [IPv6 ] [root ] [dns-server ] [2001:503:ba3e::2:30] [2013-08-28T20:40:50,000000+00:00]
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [v2 PATCH 0/5] Pull Request and v2 changes
2017-11-12 15:22 [v2 PATCH 0/5] Pull Request and v2 changes J William Piggott
` (4 preceding siblings ...)
2017-11-12 15:27 ` [v2 PATCH 5/5] tests: adjust for ISO timezone colon use J William Piggott
@ 2017-11-13 15:51 ` Karel Zak
5 siblings, 0 replies; 7+ messages in thread
From: Karel Zak @ 2017-11-13 15:51 UTC (permalink / raw)
To: J William Piggott; +Cc: util-linux
On Sun, Nov 12, 2017 at 10:22:17AM -0500, J William Piggott wrote:
> hwclock: add iso-8601 overflow check
> lib/timeutils: ISO_8601_BUFSIZ too small
> lib/timeutils: add get_gmtoff()
> lib/timeutils: add common ISO timestamp masks
> tests: adjust for ISO timezone colon use
Applied, thanks (for patience:-)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-11-13 15:51 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-12 15:22 [v2 PATCH 0/5] Pull Request and v2 changes J William Piggott
2017-11-12 15:23 ` [v2 PATCH 1/5] hwclock: add iso-8601 overflow check J William Piggott
2017-11-12 15:24 ` [v2 PATCH 2/5] lib/timeutils: ISO_8601_BUFSIZ too small J William Piggott
2017-11-12 15:25 ` [v2 PATCH 3/5] lib/timeutils: add get_gmtoff() J William Piggott
2017-11-12 15:26 ` [v2 PATCH 4/5] lib/timeutils: add common ISO timestamp masks J William Piggott
2017-11-12 15:27 ` [v2 PATCH 5/5] tests: adjust for ISO timezone colon use J William Piggott
2017-11-13 15:51 ` [v2 PATCH 0/5] Pull Request and v2 changes Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).