ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent/lib/AnyEvent/Log.pm
(Generate patch)

Comparing AnyEvent/lib/AnyEvent/Log.pm (file contents):
Revision 1.55 by root, Fri Mar 30 21:31:52 2012 UTC vs.
Revision 1.58 by root, Thu Apr 5 04:12:21 2012 UTC

1016 my $write = sub { 1016 my $write = sub {
1017 # we write as many messages as have been queued 1017 # we write as many messages as have been queued
1018 my $data = join "", @queue; 1018 my $data = join "", @queue;
1019 @queue = (); 1019 @queue = ();
1020 1020
1021 AnyEvent::IO::ae_write $fh, $data, sub { 1021 AnyEvent::IO::aio_write $fh, $data, sub {
1022 $disable = 1; 1022 $disable = 1;
1023 @_ 1023 @_
1024 ? ($_[0] == length $data or AE::log 4 => "unable to write to logfile '$path': short write") 1024 ? ($_[0] == length $data or AE::log 4 => "unable to write to logfile '$path': short write")
1025 : AE::log 4 => "unable to write to logfile '$path': $!"; 1025 : AE::log 4 => "unable to write to logfile '$path': $!";
1026 undef $disable; 1026 undef $disable;
1027 1027
1028 if ($keepopen) { 1028 if ($keepopen) {
1029 $kick->($kick); 1029 $kick->($kick);
1030 } else { 1030 } else {
1031 AnyEvent::IO::ae_close ($fh, sub { 1031 AnyEvent::IO::aio_close ($fh, sub {
1032 undef $fh; 1032 undef $fh;
1033 $kick->($kick); 1033 $kick->($kick);
1034 }); 1034 });
1035 } 1035 }
1036 }; 1036 };
1037 }; 1037 };
1038 1038
1039 if ($fh) { 1039 if ($fh) {
1040 $write->(); 1040 $write->();
1041 } else { 1041 } else {
1042 AnyEvent::IO::ae_open 1042 AnyEvent::IO::aio_open
1043 $path, 1043 $path,
1044 AnyEvent::IO::O_CREAT | AnyEvent::IO::O_WRONLY | AnyEvent::IO::O_APPEND, 1044 AnyEvent::IO::O_CREAT | AnyEvent::IO::O_WRONLY | AnyEvent::IO::O_APPEND,
1045 0666, 1045 0666,
1046 sub { 1046 sub {
1047 $fh = shift 1047 $fh = shift
1450=back 1450=back
1451 1451
1452=head1 AUTHOR 1452=head1 AUTHOR
1453 1453
1454 Marc Lehmann <schmorp@schmorp.de> 1454 Marc Lehmann <schmorp@schmorp.de>
1455 http://home.schmorp.de/ 1455 http://software.schmorp.de/pkg/AnyEvent.html
1456 1456
1457=cut 1457=cut
1458 1458
14591 14591
1460 1460

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines