When lfs is passed a "-newerXY" arg when Y=='t' and the arg doesn't
start %H, it leaves ->tm_isdst set to 0 which tells mktime() to assume
that DST is not active.
This means that it produces incorrect results for times when DST is
active.
We should set ->tm_isdst to -1 to tell mktime() that it is not known
whether DST is active. Then mktime() will use the timezone database
to determine the correct DST setting.
This allows us to re-enable test 56oc on all platforms.
Test-Parameters: trivial clientdistro=sles15sp3 env=ONLY=56
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I94afba96e2563442786726096501c5ec0b40a881
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49206
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
test_newerXY_base "c" "m"
test_newerXY_base "c" "c"
- [[ -n "$sles_version" ]] &&
- echo "skip timestamp tests on SLES, LU-13665" && return 0
-
test_newerXY_base "a" "t"
test_newerXY_base "m" "t"
test_newerXY_base "c" "t"
char *ptr;
/* Init for times relative to today */
- if (strncmp(fmts[i], "%H", 2) == 0)
+ if (strncmp(fmts[i], "%H", 2) == 0) {
localtime_r(&ref, &tm);
- else
+ } else {
memset(&tm, 0, sizeof(tm));
+ tm.tm_isdst = -1;
+ }
ptr = strptime(optarg, fmts[i], &tm);
/* Skip spaces */
while (ptr && isspace(*ptr))