diff options
| author | Bill Pijewski <wdp@joyent.com> | 2011-03-09 10:03:56 -0800 |
|---|---|---|
| committer | Bill Pijewski <wdp@joyent.com> | 2011-03-09 10:03:56 -0800 |
| commit | d3574d0a7c4866d7cf12b39b6ced99d3db15efc9 (patch) | |
| tree | 318aa6c9405d961932e79bc05aeab43cc3c49cd3 /usr/src | |
| parent | 8fa58df39dfde9b5f85df2656712e6e3c4fefef0 (diff) | |
| download | illumos-joyent-d3574d0a7c4866d7cf12b39b6ced99d3db15efc9.tar.gz | |
OS-301 'arcstat 1' does the wrong thing
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/cmd/stat/arcstat/arcstat.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr/src/cmd/stat/arcstat/arcstat.pl b/usr/src/cmd/stat/arcstat/arcstat.pl index 874d9c566b..19f85a6c31 100644 --- a/usr/src/cmd/stat/arcstat/arcstat.pl +++ b/usr/src/cmd/stat/arcstat/arcstat.pl @@ -91,7 +91,7 @@ my %v=(); my @hdr = qw(time read miss miss% dmis dm% pmis pm% mmis mm% arcsz c); my @xhdr = qw(time mfu mru mfug mrug eskip mtxmis rmis dread pread read); my $int = 1; # Print stats every 1 second by default -my $count = 1; # Print stats since boot and exit by default +my $count = 1; # Print stats since boot and exit my $hdr_intr = 20; # Print header every 20 lines of output my $opfile = ""; my $sep = " "; # Default seperator is 2 spaces @@ -138,8 +138,13 @@ sub init { 'v' => \$vflag, 's=s' => \$sep, 'f=s' => \$desired_cols); - $int = $ARGV[0] || $int; - $count = $ARGV[1] || $count; + if (defined $ARGV[0] && defined $ARGV[1]) { + $int = $ARGV[0]; + $count = $ARGV[1]; + } elsif (defined $ARGV[0]) { + $int = $ARGV[0]; + $count = 0; + } usage() if !$res or $hflag or ($xflag and $desired_cols); detailed_usage() if $vflag; @hdr = @xhdr if $xflag; #reset headers to xhdr |
