]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei: use send() perlop for signals
authorEric Wong <e@80x24.org>
Thu, 14 Oct 2021 13:16:03 +0000 (13:16 +0000)
committerEric Wong <e@80x24.org>
Fri, 15 Oct 2021 02:23:22 +0000 (02:23 +0000)
This may save us a small bit of startup time since there's
fewer args and opcodes should be smaller.

script/lei

index 8f6e8aacb86b67470d2dade0fdd7225cc6e7df0a..5cad19d776034176552fa352cb6a4415022683e3 100755 (executable)
@@ -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) {