about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-23 11:48:06 +0000
committerEric Wong <e@80x24.org>2021-03-24 01:33:26 +0000
commit05872a1ba3a01bdcd81402f37b3bf9c477f7c9fc (patch)
tree4e744950f219edf3d6f6cb7180bbd57278a16f02
parent84f60edcc873d55c949d2ea7eccca6f46bcb5400 (diff)
downloadpublic-inbox-05872a1ba3a01bdcd81402f37b3bf9c477f7c9fc.tar.gz
Since each lei->event_step can change the directory of
lei-daemon, we need to ensure the lei_store runs in a
directory that is stable.
-rw-r--r--lib/PublicInbox/LEI.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index 17ca637e..d3ac19b2 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -453,6 +453,7 @@ sub _lei_atfork_child {
         my ($self, $persist) = @_;
         # we need to explicitly close things which are on stack
         if ($persist) {
+                chdir '/' or die "chdir(/): $!";
                 my @io = delete @$self{qw(0 1 2 sock)};
                 unless ($self->{oneshot}) {
                         close($_) for @io;