X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=script%2Flei;h=5cad19d776034176552fa352cb6a4415022683e3;hb=6e0ac7612095397ef3b9e019f772d724c62eac5b;hp=399296ba1a8d453597e93dc0cb9dfa9b7c99b916;hpb=5c7d3f916da9a9c93419282e943a7d45c53b9c86;p=public-inbox.git diff --git a/script/lei b/script/lei index 399296ba..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) { @@ -122,6 +122,8 @@ while (1) { $exec_cmd->(\@fds, split(/\0/, $1)); } elsif ($buf eq '-WINCH') { kill($buf, @parent); # for MUA + } elsif ($buf eq 'umask') { + send($sock, 'u'.pack('V', umask), MSG_EOR) or die "send: $!" } elsif ($buf =~ /\Ax_it ([0-9]+)\z/) { $x_it_code ||= $1 + 0; last; @@ -137,6 +139,6 @@ while (1) { $sigchld->(); if (my $sig = ($x_it_code & 127)) { kill $sig, $$; - sleep(1) while 1; + sleep(1) while 1; # no self-pipe/signalfd, here, so we loop } exit($x_it_code >> 8);