Skip to content

Commit

Permalink
fix utime() to set $!/errno when called on a closed handle
Browse files Browse the repository at this point in the history
My 8334cae was intended to fix this, but the test was faulty, and
didn't correctly fail.

This started showing as a failure on cygwin, with the fixed test it
also fails on Linux, so fix doio.c as well.
  • Loading branch information
tonycoz committed May 24, 2021
1 parent eaff4b5 commit 8f432bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions doio.c
Expand Up @@ -2766,6 +2766,7 @@ nothing in the core.
#endif
}
else {
SETERRNO(EBADF,RMS_IFI);
tot--;
}
}
Expand Down
1 change: 1 addition & 0 deletions t/io/fs.t
Expand Up @@ -265,6 +265,7 @@ SKIP: {
check_utime_result($ut, $accurate_timestamps, $delta);
# [perl #122703]
close $fh;
$! = 0;
ok(!utime($ut,$ut + $delta, $fh),
"utime fails on a closed file handle");
isnt($!+0, 0, "and errno was set");
Expand Down

0 comments on commit 8f432bc

Please sign in to comment.