From: Eric Wong Date: Wed, 22 Sep 2021 02:24:29 +0000 (+0000) Subject: ipc: do not add "0" to $0 of solo workers X-Git-Tag: v1.7.0~300 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=30cc504b0e88302588ca26e91b8005ec62d5d6f2;p=public-inbox.git ipc: do not add "0" to $0 of solo workers It's needless noise and misleads users reading "ps" into thinking there's more workers when there's only one. --- diff --git a/lib/PublicInbox/IPC.pm b/lib/PublicInbox/IPC.pm index add5f3df..1c699d76 100644 --- a/lib/PublicInbox/IPC.pm +++ b/lib/PublicInbox/IPC.pm @@ -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 {