diff options
author | Eric Wong <e@yhbt.net> | 2020-03-22 08:58:48 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-03-24 22:00:25 +0000 |
commit | d7fda3f4b9d4c9e6d01c818f09905d6827fa693f (patch) | |
tree | eff9163fcada3fd086e0f74684422a293ccfdf7e /lib/PublicInbox/Daemon.pm | |
parent | c7acdfe78bda5bf36660a699e882e0e3c431a351 (diff) | |
download | public-inbox-d7fda3f4b9d4c9e6d01c818f09905d6827fa693f.tar.gz |
Disabling workers via `-W0' blesses the contents of the @listeners array, so we need to ensure we call fcntl on the GLOB ref in ->{sock}. Add tests to ensure USR2 works regardless of whether workers are enabled or not.
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r-- | lib/PublicInbox/Daemon.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 43ef2691..3d582e35 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -403,6 +403,9 @@ sub upgrade { # $_[0] = signal name or number (unused) $ENV{LISTEN_FDS} = scalar @listeners; $ENV{LISTEN_PID} = $$; foreach my $s (@listeners) { + # @listeners are globs with workers, PI::L w/o workers + $s = $s->{sock} if ref($s) eq 'PublicInbox::Listener'; + my $fl = fcntl($s, F_GETFD, 0); fcntl($s, F_SETFD, $fl &= ~FD_CLOEXEC); } |