Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time::HiRes: allow not checking atime between stat and lstat #20908

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions dist/Time-HiRes/Changes
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Revision history for the Perl extension Time::HiRes.
- darwin: make sure the compiler can find the system perl headers
https://github.com/Perl/perl5/issues/20362
- darwin: make sure PERL_DARWIN is defined on darwin.
- don't compare stat and lstat atime if PERL_FILE_ATIME_CHANGES is set in
the environment.
https://github.com/Perl/perl5/issues/19321

1.9764 [2020-08-10]
- Fix a bunch of repeated-word typos
Expand Down
6 changes: 5 additions & 1 deletion dist/Time-HiRes/t/stat.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ for (1..5) {
SKIP: {
if($^O eq "haiku") {
skip "testing stat access time on Haiku", 2;
}
}
if ($ENV{PERL_FILE_ATIME_CHANGES}) {
# something else might access the file, changing atime
$lstat->[8] = $stat->[8];
}
is_deeply $lstat, $stat, "write: stat and lstat returned same values";
Time::HiRes::sleep(rand(0.1) + 0.1);
open(X, '<', $$);
Expand Down