]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
treewide: use *nix-specific dirname regexps
[public-inbox.git] / lib / PublicInbox / LEI.pm
index d9fd40fd90e8244399e89a252f7f55a943cc2ea5..be4754df8d162448fe9a81b69093d3242084f6d2 100644 (file)
@@ -556,7 +556,7 @@ sub _lei_atfork_child {
        }
        close $listener if $listener;
        undef $listener;
-       undef $dir_idle;
+       $dir_idle->force_close if $dir_idle;
        %PATH2CFG = ();
        $MDIR2CFGPATH = {};
        eval 'no warnings; undef $PublicInbox::LeiNoteEvent::to_flush';
@@ -798,7 +798,7 @@ sub _lei_cfg ($;$) {
                        delete $self->{cfg};
                        return bless {}, 'PublicInbox::Config';
                }
-               my (undef, $cfg_dir, undef) = File::Spec->splitpath($f);
+               my ($cfg_dir) = ($f =~ m!(.*?/)[^/]+\z!);
                -d $cfg_dir or mkpath($cfg_dir) or die "mkpath($cfg_dir): $!\n";
                open my $fh, '>>', $f or die "open($f): $!\n";
                @st = stat($fh) or die "fstat($f): $!\n";