-sub reap { # callback for EOFpipe
- my ($pid, $cb, $self) = @{$_[0]};
- my $ret = waitpid($pid, 0);
- if ($ret == $pid) {
- $cb->($self, $pid); # poll_fetch_reap || imap_idle_reap
- } else {
- warn "W: waitpid($pid) => ", $ret // "($!)", "\n";
- }
-}
-
-sub imap_idle_fork ($$) {
- my ($self, $uri_intvl) = @_;
- my ($uri, $intvl) = @$uri_intvl;
- pipe(my ($r, $w)) or die "pipe: $!";
+sub imap_idle_fork {
+ my ($self, $uri, $intvl) = @_;
+ return if $self->{quit};