Skip to content

Commit

Permalink
IO: implement sync() for win32
Browse files Browse the repository at this point in the history
  • Loading branch information
xenu committed May 21, 2021
1 parent 77d67a7 commit 52f0602
Show file tree
Hide file tree
Showing 12 changed files with 16 additions and 12 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

0 comments on commit 52f0602

Please sign in to comment.