From 8e65d060aa5ad4544313238c5295c018d3031218 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Wed, 9 May 2012 08:51:38 -0700 Subject: Moved get_terminal_width to Vyatta::Misc --- scripts/vyatta-show-interfaces.pl | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/scripts/vyatta-show-interfaces.pl b/scripts/vyatta-show-interfaces.pl index 3a9f1cc..b8a5ae6 100755 --- a/scripts/vyatta-show-interfaces.pl +++ b/scripts/vyatta-show-interfaces.pl @@ -24,7 +24,6 @@ # use lib "/opt/vyatta/share/perl5/"; -require 'sys/ioctl.ph'; use Vyatta::Interface; use Vyatta::Misc; @@ -55,17 +54,6 @@ my @rx_stat_vars = my @tx_stat_vars = qw/tx_bytes tx_packets tx_errors tx_dropped tx_carrier_errors collisions/; -sub get_terminal_width { - my $winsize = ''; - open(my $TTY, '>', '/dev/tty'); - # undefined if output not going to terminal - return unless (ioctl($TTY, &TIOCGWINSZ, $winsize)); - close($TTY); - - my ($rows, $cols, undef, undef) = unpack('S4', $winsize); - return $cols; -} - sub get_intf_description { my $name = shift; my $description = interface_description($name); -- cgit v1.2.3