i3-dmenu-desktop: ignore SIGPIPE when writing to dmenu (#5228)
Fixes broken test
This commit is contained in:
parent
1f53ae4614
commit
080c73d1a4
@ -366,9 +366,14 @@ binmode $dmenu_in, ':utf8';
|
||||
binmode $dmenu_out, ':utf8';
|
||||
|
||||
# Feed dmenu the possible choices.
|
||||
# Since the process might have already exited, we ignore SIGPIPE.
|
||||
$SIG{PIPE} = 'IGNORE';
|
||||
|
||||
say $dmenu_in $_ for sort keys %choices;
|
||||
close($dmenu_in);
|
||||
|
||||
$SIG{PIPE} = 'DEFAULT';
|
||||
|
||||
waitpid($pid, 0);
|
||||
my $status = ($? >> 8);
|
||||
|
||||
|
@ -67,10 +67,8 @@ EOT
|
||||
|
||||
# complete-run.pl arranges for $PATH to be set up such that the
|
||||
# i3-dmenu-desktop version we execute is the one from the build directory.
|
||||
my $exit = system("i3-dmenu-desktop --dmenu 'echo i3-testsuite-$testcnt' &");
|
||||
if ($exit != 0) {
|
||||
die "failed to run i3-dmenu-desktop";
|
||||
}
|
||||
my $exit = system("(i3-dmenu-desktop --dmenu 'echo i3-testsuite-$testcnt' || echo failed with \$? > $tmpdir/fifo) &");
|
||||
die "failed to start i3-dmenu-desktop" unless $exit == 0;
|
||||
|
||||
chomp($want_arg); # trim trailing newline
|
||||
my $got_args = decode_json(slurp("$tmpdir/fifo"));
|
||||
|
Loading…
Reference in New Issue
Block a user