- } elsif ($mask & MOVED_TO_OR_CREATE) {
- my @new_st = stat($path) or next;
- $self->{watch}->{$ident}->[3] = $new_st[10]; # ctime
+ } elsif ($mask & (MOVED_TO_OR_CREATE|NOTE_DELETE|NOTE_LINK|
+ NOTE_REVOKE|NOTE_RENAME)) {
+ my @new_st = stat($path);
+ if (!@new_st && $!{ENOENT}) {
+ push @$events, bless(\$path,
+ 'PublicInbox::FakeInotify::'.
+ 'SelfGoneEvent');
+ push @gone, $ident;
+ delete $self->{dirlist}->{$path};
+ next;
+ }
+ if (!@new_st) {
+ warn "unhandled stat($path) error: $!\n";
+ next;
+ }
+ $watch->{$ident}->[3] = $new_st[10]; # ctime