From e2d46d7a11901dc8667f05f39d380ee4907bab93 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 11 Jan 2011 11:09:36 +0000 Subject: implemented prodection against broken pipe (remote ssh connection pipe) --- loadbars.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/loadbars.pl b/loadbars.pl index 31a1acc..0c3b7c0 100755 --- a/loadbars.pl +++ b/loadbars.pl @@ -42,7 +42,7 @@ use SDL::Rect; use SDL::Color; use SDL::Event; -#use SDL::TTF qw(); +use SDL::Font; use Time::HiRes qw(usleep gettimeofday); @@ -132,7 +132,10 @@ BASH my $cmd = $host eq 'localhost' ? $bash : "ssh -o StrictHostKeyChecking=no $CONF{sshopts} $host '$bash'"; - my $pid = open2 my $out, my $in, $cmd or die "Error: $!\n"; + my $pid = open2 my $out, my $in, $cmd or do { + say "Warning: $!"; + return; + }; $SIG{STOP} = sub { say "Shutting down get_stat($host) & PID $pid"; -- cgit v1.2.3