+ # start reading all filter stderr
+ foreach my $filter (@{$self->{'xfer_filters'}}) {
+ my $fd = $filter->get_stderr_fd();
+ $fd.="";
+ $fd = int($fd);
+ my $src = Amanda::MainLoop::fd_source($fd,
+ $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+ my $buffer = "";
+ $self->{'all_filter'}{$src} = 1;
+ $src->set_callback( sub {
+ my $b;
+ my $n_read = POSIX::read($fd, $b, 1);
+ if (!defined $n_read) {
+ return;
+ } elsif ($n_read == 0) {
+ delete $self->{'all_filter'}->{$src};
+ $src->remove();
+ POSIX::close($fd);
+ if (!%{$self->{'all_filter'}} and $self->{'fetch_done'}) {
+ Amanda::MainLoop::quit();
+ }
+ } else {
+ $buffer .= $b;
+ if ($b eq "\n") {
+ my $line = $buffer;
+ #print STDERR "filter stderr: $line";
+ chomp $line;
+ $self->sendmessage("filter stderr: $line");
+ debug("filter stderr: $line");
+ $buffer = "";
+ }
+ }
+ });
+ }
+