inotify_add_watch(2), open(2), stat(2) may all fail due to
permissions errors, especially when running -nntpd/-imapd
as `nobody' as recommended.
$cur->[0] = $ibx;
my $lock = "$dir/".($ibx->version >= 2 ? 'inbox.lock' : 'ssoma.lock');
- my $w = $cur->[1] = $inot->watch($lock, $IN_MODIFY);
- $self->{on_unlock}->{$w->name} = $ibx;
+ if (my $w = $cur->[1] = $inot->watch($lock, $IN_MODIFY)) {
+ $self->{on_unlock}->{$w->name} = $ibx;
+ } else {
+ warn "E: ".ref($inot)."->watch($lock, IN_MODIFY) failed: $!\n";
+ }
# TODO: detect deleted packs (and possibly other files)
}