Skip to content

Commit

Permalink
Merge 372b43d into 61d18b6
Browse files Browse the repository at this point in the history
  • Loading branch information
xenu committed May 4, 2021
2 parents 61d18b6 + 372b43d commit 42b3c04
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/IO/IO.pm
Expand Up @@ -7,7 +7,7 @@ use Carp;
use strict;
use warnings;

our $VERSION = "1.46";
our $VERSION = "1.47";
XSLoader::load 'IO', $VERSION;

sub import {
Expand Down
6 changes: 5 additions & 1 deletion dist/IO/IO.xs
Expand Up @@ -528,14 +528,18 @@ fsync(arg)
PREINIT:
OutputStream handle = NULL;
CODE:
#ifdef HAS_FSYNC
#if defined(HAS_FSYNC) || defined(_WIN32)
handle = IoOFP(sv_2io(arg));
if (!handle)
handle = IoIFP(sv_2io(arg));
if (handle) {
int fd = PerlIO_fileno(handle);
if (fd >= 0) {
# ifdef _WIN32
RETVAL = _commit(fd);
# else
RETVAL = fsync(fd);
# endif
} else {
RETVAL = -1;
errno = EBADF;
Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Dir.pm
Expand Up @@ -18,7 +18,7 @@ use File::stat;
use File::Spec;

our @ISA = qw(Tie::Hash Exporter);
our $VERSION = "1.46";
our $VERSION = "1.47";

our @EXPORT_OK = qw(DIR_UNLINK);

Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/File.pm
Expand Up @@ -135,7 +135,7 @@ require Exporter;

our @ISA = qw(IO::Handle IO::Seekable Exporter);

our $VERSION = "1.46";
our $VERSION = "1.47";

our @EXPORT = @IO::Seekable::EXPORT;

Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Handle.pm
Expand Up @@ -270,7 +270,7 @@ use IO (); # Load the XS module
require Exporter;
our @ISA = qw(Exporter);

our $VERSION = "1.46";
our $VERSION = "1.47";

our @EXPORT_OK = qw(
autoflush
Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Pipe.pm
Expand Up @@ -13,7 +13,7 @@ use strict;
use Carp;
use Symbol;

our $VERSION = "1.46";
our $VERSION = "1.47";

sub new {
my $type = shift;
Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Poll.pm
Expand Up @@ -12,7 +12,7 @@ use IO::Handle;
use Exporter ();

our @ISA = qw(Exporter);
our $VERSION = "1.46";
our $VERSION = "1.47";

our @EXPORT = qw( POLLIN
POLLOUT
Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Seekable.pm
Expand Up @@ -106,7 +106,7 @@ require Exporter;
our @EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END);
our @ISA = qw(Exporter);

our $VERSION = "1.46";
our $VERSION = "1.47";

sub seek {
@_ == 3 or croak 'usage: $io->seek(POS, WHENCE)';
Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Select.pm
Expand Up @@ -10,7 +10,7 @@ use strict;
use warnings::register;
require Exporter;

our $VERSION = "1.46";
our $VERSION = "1.47";

our @ISA = qw(Exporter); # This is only so we can do version checking

Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Socket.pm
Expand Up @@ -23,7 +23,7 @@ require IO::Socket::UNIX if ($^O ne 'epoc' && $^O ne 'symbian');

our @ISA = qw(IO::Handle);

our $VERSION = "1.46";
our $VERSION = "1.47";

our @EXPORT_OK = qw(sockatmark);

Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Socket/INET.pm
Expand Up @@ -14,7 +14,7 @@ use Exporter;
use Errno;

our @ISA = qw(IO::Socket);
our $VERSION = "1.46";
our $VERSION = "1.47";

my $EINVAL = exists(&Errno::EINVAL) ? Errno::EINVAL() : 1;

Expand Down
2 changes: 1 addition & 1 deletion dist/IO/lib/IO/Socket/UNIX.pm
Expand Up @@ -11,7 +11,7 @@ use IO::Socket;
use Carp;

our @ISA = qw(IO::Socket);
our $VERSION = "1.46";
our $VERSION = "1.47";

IO::Socket::UNIX->register_domain( AF_UNIX );

Expand Down
11 changes: 10 additions & 1 deletion dist/IO/t/io_xs.t
Expand Up @@ -11,7 +11,7 @@ BEGIN {
}
}

use Test::More tests => 10;
use Test::More tests => 11;
use IO::File;
use IO::Seekable;

Expand All @@ -35,6 +35,15 @@ $! = 0;
$x->setpos(undef);
ok($!, "setpos(undef) makes errno non-zero");

SKIP:
{
$Config{d_fsync} || $^O eq 'MSWin32'
or skip "No fsync", 1;

ok($x->sync, "sync on a writable handle")
or diag "sync(): ", $!;
}

SKIP:
{ # [perl #64772] IO::Handle->sync fails on an O_RDONLY descriptor
$Config{d_fsync}
Expand Down

0 comments on commit 42b3c04

Please sign in to comment.