From cdc569fa2ffcf57e1ebd37621d4d07a9b303c38f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 14 Oct 2021 13:16:03 +0000 Subject: lei: use send() perlop for signals 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(-) (limited to 'script') diff --git a/script/lei b/script/lei index 8f6e8aac..5cad19d7 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) { -- cgit v1.2.3-24-ge0c7