mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-24 05:15:02 +00:00
Pingback::_touch should update the [ma]time of the file
This commit is contained in:
@@ -176,6 +176,7 @@ sub _touch {
|
|||||||
sysopen my $fh, $file, O_WRONLY|O_CREAT|O_NONBLOCK
|
sysopen my $fh, $file, O_WRONLY|O_CREAT|O_NONBLOCK
|
||||||
or die "Cannot create $file : $!";
|
or die "Cannot create $file : $!";
|
||||||
close $fh or die "Cannot close $file : $!";
|
close $fh or die "Cannot close $file : $!";
|
||||||
|
utime(undef, undef, $file);
|
||||||
}
|
}
|
||||||
|
|
||||||
sub encode_client_response {
|
sub encode_client_response {
|
||||||
|
@@ -215,6 +215,11 @@ ok(
|
|||||||
"time_to_check returns true if the file exists and it's mtime is at least one day old",
|
"time_to_check returns true if the file exists and it's mtime is at least one day old",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ok(
|
||||||
|
!Pingback::time_to_check($file),
|
||||||
|
"...but fails if tried a second time, as the mtime has been updated",
|
||||||
|
);
|
||||||
|
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
# Done.
|
# Done.
|
||||||
# #############################################################################
|
# #############################################################################
|
||||||
|
Reference in New Issue
Block a user