diff options
author | Tony Cook <tony@develop-help.com> | 2012-06-23 13:41:19 +1000 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2012-06-24 11:39:39 +1000 |
commit | 123a72adf67212f99c8db130ce728ddd19243287 (patch) | |
tree | ea751937efceb07f96e2ed822f85495fb433b86f /dist | |
parent | 2c5f48c251e2743cd9eea14146c6844e4ee5a55c (diff) | |
download | perl-123a72adf67212f99c8db130ce728ddd19243287.tar.gz |
[perl #64772] make the read-only-sync test a bit more portable
- Win32 simply doesn't support fsync, and %Config reflects that
- sync() on a file seems more portable to me than on a directory, and
the first is enough to test the code path we want to test.
- AIX is documented to fail fsync() on a read-only handle, so skip
there
Diffstat (limited to 'dist')
-rw-r--r-- | dist/IO/t/io_xs.t | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/dist/IO/t/io_xs.t b/dist/IO/t/io_xs.t index 968b3f516d..85fbc5668f 100644 --- a/dist/IO/t/io_xs.t +++ b/dist/IO/t/io_xs.t @@ -40,10 +40,12 @@ $x->setpos(undef); ok($!, "setpos(undef) makes errno non-zero"); SKIP: -{ - $^O eq "MSWin32" - and skip "directory sync doesn't apply to MSWin32", 1; - open my $dh, "<", "." - or skip "Cannot open the cwd", 1; - ok($dh->sync, "sync to a read only directory handle"); +{ # [perl #64772] IO::Handle->sync fails on an O_RDONLY descriptor + $Config{d_fsync} + or skip "No fsync", 1; + $^O eq 'aix' + and skip "fsync() documented to fail on non-writable handles on AIX", 1; + open my $fh, "<", "t/io_xs.t" + or skip "Cannot open t/io_xs.t read-only: $!", 1; + ok($fh->sync, "sync to a read only handle"); } |