]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ipc: do not add "0" to $0 of solo workers
authorEric Wong <e@80x24.org>
Wed, 22 Sep 2021 02:24:29 +0000 (02:24 +0000)
committerEric Wong <e@80x24.org>
Wed, 22 Sep 2021 05:21:18 +0000 (05:21 +0000)
It's needless noise and misleads users reading "ps" into
thinking there's more workers when there's only one.

lib/PublicInbox/IPC.pm

index add5f3dfd1d4a6377077a5ebbe414ded1f0215c7..1c699d76fea1578558ec5361ae5d8e19913deef7 100644 (file)
@@ -353,7 +353,8 @@ sub _wq_worker_start ($$$$) {
                                keys %{delete($self->{-wq_workers}) // {}};
                $SIG{$_} = 'IGNORE' for (qw(PIPE));
                $SIG{$_} = 'DEFAULT' for (qw(TTOU TTIN TERM QUIT INT CHLD));
-               local $0 = "$self->{-wq_ident} $self->{-wq_worker_nr}";
+               local $0 = $one ? $self->{-wq_ident} :
+                       "$self->{-wq_ident} $self->{-wq_worker_nr}";
                # ensure we properly exit even if warn() dies:
                my $end = PublicInbox::OnDestroy->new($$, sub { exit(!!$@) });
                eval {