From dd9e692fcedf220bca2b6981184c6ba2738cb6c3 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sun, 17 Dec 2017 00:23:35 +0100 Subject: Delete the error pipe Now that we're passing errors on the main pipe (9c43c1637587e004c4826d79021e4d6164543e1e), we no longer need this one. --- vimput.pl | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/vimput.pl b/vimput.pl index 01a90bf..ce37273 100644 --- a/vimput.pl +++ b/vimput.pl @@ -64,16 +64,13 @@ sub open_tmux_split { sub update_input_line_when_finished { return if $forked; - my ($read_handle, $write_handle, $err_read_handle, $err_write_handle); + my ($read_handle, $write_handle); pipe($read_handle, $write_handle); - # pipe($err_read_handle, $err_write_handle); sub cleanup { close $read_handle; close $write_handle; - # close $err_read_handle; - # close $err_write_handle; } my $pid = fork(); @@ -93,12 +90,7 @@ sub update_input_line_when_finished { my $fifo_path = tmpnam(); open_tmux_split($fifo_path, $write_handle) or do { - # print $err_write_handle 'Not running in tmux.'; - # print 'fuck'; - # Irssi::print('fuck'); - # print $write_handle 'ERROR: Not running in tmux.'; cleanup(); - # die; POSIX::_exit(1); }; @@ -138,15 +130,6 @@ sub update_input_line_when_finished { \&pipe_input, \@args, ); - - # my $err_pipe_tag; - # my @err_args = ($err_read_handle, \$err_pipe_tag); - # $err_pipe_tag = Irssi::input_add( - # fileno $err_read_handle, - # Irssi::INPUT_READ, - # \&pipe_error, - # \@err_args, - # ); } } @@ -176,24 +159,6 @@ sub pipe_input { } -sub pipe_error { - my ($args) = @_; - my ($err_read_handle, $err_pipe_tag) = @$args; - - my $input = <$err_read_handle>; - - Irssi::print($input, MSGLEVEL_CLIENTERROR); - - $forked = 0; - - close $err_read_handle; - Irssi::input_remove($$err_pipe_tag); - - kill 'TERM', $child; - undef $child; -} - - sub is_child_fork { my ($pid) = @_; -- cgit v1.2.3