# NOTE: Derived from ../../lib/Storable.pm.
# Changes made here will be lost when autosplit is run again.
#line 190 "../../lib/Storable.pm (autosplit into ../../lib/auto/Storable/_store.al)"
# Internal store to file routine
my ($file, $use_locking) = @_;
logcroak "not a reference" unless ref($self);
logcroak "wrong argument number" unless @_ == 2; # No @foo in arglist
open(FILE, ">>$file") || logcroak "can't write into $file: $!";
logcarp "Storable::lock_store: fcntl/flock emulation broken on $^O";
logcroak "can't get exclusive lock on $file: $!";
# Unlocking will happen when FILE is closed
open(FILE, ">$file") || logcroak "can't create $file: $!";
binmode FILE; # Archaic systems...
my $da = $@; # Don't mess if called from exception handler
# Call C routine nstore or pstore, depending on network order
eval { $ret = &$xsptr(*FILE, $self) };
close(FILE) or $ret = undef;
unlink($file) or warn "Can't unlink $file: $!\n" if $@ || !defined $ret;
logcroak $@ if $@ =~ s/\.?\n$/,/;
return $ret ? $ret : undef;
# end of Storable::_store