From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A68511F9F3 for ; Thu, 14 Oct 2021 13:16:09 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/7] lei: use send() perlop for signals Date: Thu, 14 Oct 2021 13:16:03 +0000 Message-Id: <20211014131609.829-2-e@80x24.org> In-Reply-To: <20211014131609.829-1-e@80x24.org> References: <20211014131609.829-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This may save us a small bit of startup time since there's fewer args and opcodes should be smaller. --- script/lei | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/lei b/script/lei index 8f6e8aacb86b..5cad19d77603 100755 --- a/script/lei +++ b/script/lei @@ -107,8 +107,8 @@ my $buf = join("\0", scalar(@ARGV), @ARGV); while (my ($k, $v) = each %ENV) { $buf .= "\0$k=$v" } $buf .= "\0\0"; $send_cmd->($sock, [0, 1, 2, fileno($dh)], $buf, MSG_EOR) or die "sendmsg: $!"; -$SIG{TSTP} = sub { $send_cmd->($sock, [], 'STOP', MSG_EOR); kill 'STOP', $$ }; -$SIG{CONT} = sub { $send_cmd->($sock, [], 'CONT', MSG_EOR) }; +$SIG{TSTP} = sub { send($sock, 'STOP', MSG_EOR); kill 'STOP', $$ }; +$SIG{CONT} = sub { send($sock, 'CONT', MSG_EOR) }; my $x_it_code = 0; while (1) {