diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-17 10:38:08 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-03-17 10:38:08 -0700 |
commit | c667c9b128af7a9d8344459c8c65ee9ee8703f02 (patch) | |
tree | 7d81e69553460d081b899016bcc6b0c9e395baa5 /lib/Vyatta/Qos/NetworkEmulator.pm | |
parent | 426d6086ebecea13fe29721130f071284ebca899 (diff) | |
download | vyatta-cfg-qos-c667c9b128af7a9d8344459c8c65ee9ee8703f02.tar.gz vyatta-cfg-qos-c667c9b128af7a9d8344459c8c65ee9ee8703f02.zip |
Use select to avoid passing output path around
Easier to just use 'select' in perl to avoid passing file
descriptor everywhere.
Diffstat (limited to 'lib/Vyatta/Qos/NetworkEmulator.pm')
-rw-r--r-- | lib/Vyatta/Qos/NetworkEmulator.pm | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Vyatta/Qos/NetworkEmulator.pm b/lib/Vyatta/Qos/NetworkEmulator.pm index 47b0174..1458dd4 100644 --- a/lib/Vyatta/Qos/NetworkEmulator.pm +++ b/lib/Vyatta/Qos/NetworkEmulator.pm @@ -52,37 +52,37 @@ sub new { } sub commands { - my ( $self, $out, $dev ) = @_; + my ( $self, $dev ) = @_; my $rate = $self->{_rate}; if ($rate) { my $burst = $self->{_burst}; $burst or $burst = "15K"; - printf {$out} "qdisc add dev %s root handle 1:0 tbf rate %s burst %s\n", + printf "qdisc add dev %s root handle 1:0 tbf rate %s burst %s\n", $dev, $rate, $burst; - printf {$out} "qdisc add dev %s parent 1:1 handle 10: netem"; + printf "qdisc add dev %s parent 1:1 handle 10: netem"; } else { - printf {$out} "qdisc add dev %s root netem"; + printf "qdisc add dev %s root netem"; } my $delay = $self->{_delay}; - print {$out} " delay $delay" if ($delay); + print " delay $delay" if ($delay); my $limit = $self->{_limit}; - print {$out} " limit $limit" if ($limit); + print " limit $limit" if ($limit); my $drop = $self->{_drop}; - print {$out} " drop $drop" if ($drop); + print " drop $drop" if ($drop); my $corrupt = $self->{_corrupt}; - print {$out} " corrupt $corrupt" if ($corrupt); + print " corrupt $corrupt" if ($corrupt); my $reorder = $self->{_reorder}; - print {$out} " reorder $reorder" if ($reorder); + print " reorder $reorder" if ($reorder); - print {$out} "\n"; + print "\n"; } sub isChanged { |