summaryrefslogtreecommitdiff
path: root/loadbars.pl
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2011-01-11 11:09:36 +0000
committerPaul Buetow <paul@buetow.org>2011-01-11 11:09:36 +0000
commite2d46d7a11901dc8667f05f39d380ee4907bab93 (patch)
tree3643ba1dd54e0c5828683fe755e71cb91f0407d1 /loadbars.pl
parent6b4dd871aaee1a0f7849092141fa01c5b57c28ad (diff)
implemented prodection against broken pipe (remote ssh connection pipe)
Diffstat (limited to 'loadbars.pl')
-rwxr-xr-xloadbars.pl7
1 files 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";