]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: date: fix false failure on OpenBSD 7.8
authorPádraig Brady <P@draigBrady.com>
Tue, 7 Apr 2026 22:17:36 +0000 (23:17 +0100)
committerPádraig Brady <P@draigBrady.com>
Tue, 7 Apr 2026 22:17:36 +0000 (23:17 +0100)
* tests/date/date.pl: Set the max supported year to INT_MAX.
Most systems support INT_MAX+1900, but mktime() on OpenBSD 7.8
limits the passed tm_year to INT_MAX.
Reported by Bruno Haible.

tests/date/date.pl

index d5a93ff9b36f57d9d1379afb59150f0b9a3de48e..40ad01bce7e6440e3235f7f02fa88c79d1875350 100755 (executable)
 use strict;
 
 my $limits = getlimits ();
-my $large_year = $limits->{INT_MAX} + 1900;
-my $large_year_out_of_range = $large_year + 1;
+# Most systems support INT_MAX + 1900, but OpenBSD 7.8
+# limits tm_year in mktime to INT_MAX.
+my $large_year = $limits->{INT_MAX};
+my $large_year_out_of_range = $large_year + 1900 + 1;
 
 (my $ME = $0) =~ s|.*/||;