diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-12 15:36:34 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-08-12 15:36:34 +0200 |
commit | dcaed97e0f44d0cd285fb590ec6ec80d0d73e738 (patch) | |
tree | dac87aa404d65f4354fa153e7732a44d8f48b084 /procps | |
parent | 7783248eaac715b813f0635b06cc140ea99bb4d9 (diff) | |
download | busybox-dcaed97e0f44d0cd285fb590ec6ec80d0d73e738.tar.gz |
iostat: add forgotted fclose(); fix default count.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r-- | procps/iostat.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/procps/iostat.c b/procps/iostat.c index 8641c2391..76c5353cc 100644 --- a/procps/iostat.c +++ b/procps/iostat.c @@ -20,8 +20,8 @@ #include "libbb.h" #include <sys/utsname.h> /* Need struct utsname */ -#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) -//#define debug(fmt, ...) ((void)0) +//#define debug(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__) +#define debug(fmt, ...) ((void)0) #define MAX_DEVICE_NAME 12 #define CURRENT 0 @@ -402,6 +402,8 @@ static void do_disk_statistics(cputime_t itv) continue; } } + + fclose(fp); } static void dev_report(cputime_t itv) @@ -493,7 +495,7 @@ int iostat_main(int argc, char **argv) { int opt, dev_num; unsigned interval = 0; - int count = 0; + int count; cputime_t global_uptime[2] = { 0 }; cputime_t smp_uptime[2] = { 0 }; cputime_t itv; @@ -537,10 +539,11 @@ int iostat_main(int argc, char **argv) argv++; } + count = 1; if (*argv) { /* Get interval */ interval = xatoi_positive(*argv); - count = interval ? -1 : 1; + count = (interval != 0 ? -1 : 1); argv++; if (*argv) /* Get count value */ |