summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasomers <asomers@FreeBSD.org>2016-02-22 21:40:53 +0000
committerasomers <asomers@FreeBSD.org>2016-02-22 21:40:53 +0000
commit4a5681f2fabaf791cc81e242967bd9d090181bb0 (patch)
tree25b10a10c1ca781935353a6fdbd123d5c281d297
parent363f920404540e03f31ae9a02cd0a2f8dd14a5c5 (diff)
downloadFreeBSD-src-4a5681f2fabaf791cc81e242967bd9d090181bb0.zip
FreeBSD-src-4a5681f2fabaf791cc81e242967bd9d090181bb0.tar.gz
Fix the usr.sbin/iostat build with GCC, broken by r295768
Renamed some local variables for compatibility with -Wshadow Reported by: Andrew Turner Tested by: ken MFC after: 4 weeks X-MFC-with: 295768 Sponsored by: Spectra Logic Corp
-rw-r--r--usr.sbin/iostat/iostat.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index 7610a7f..e9229e9 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -797,7 +797,7 @@ devstats(int perf_select, long double etime, int havelast)
long double total_mb, blocks_per_second, total_duration;
long double ms_per_other, ms_per_read, ms_per_write, ms_per_transaction;
int firstline = 1;
- char *devname;
+ char *devicename;
if (xflag > 0) {
printf(" extended device statistics ");
@@ -871,7 +871,7 @@ devstats(int perf_select, long double etime, int havelast)
}
if (xflag > 0) {
- if (asprintf(&devname, "%s%d",
+ if (asprintf(&devicename, "%s%d",
cur.dinfo->devices[di].device_name,
cur.dinfo->devices[di].unit_number) == -1)
err(1, "asprintf");
@@ -887,7 +887,7 @@ devstats(int perf_select, long double etime, int havelast)
printf("%-8.8s %5d %5d %8.1Lf "
"%8.1Lf %5d %5d %5d %5d "
"%4" PRIu64 " %3.0Lf ",
- devname,
+ devicename,
(int)transfers_per_second_read,
(int)transfers_per_second_write,
mb_per_second_read * 1024,
@@ -900,7 +900,7 @@ devstats(int perf_select, long double etime, int havelast)
printf("%-8.8s %11.1Lf %11.1Lf "
"%12.1Lf %12.1Lf %4" PRIu64
" %10.1Lf %9.1Lf ",
- devname,
+ devicename,
(long double)total_transfers_read,
(long double)total_transfers_write,
(long double)
@@ -925,7 +925,7 @@ devstats(int perf_select, long double etime, int havelast)
}
printf("\n");
}
- free(devname);
+ free(devicename);
} else if (oflag > 0) {
int msdig = (ms_per_transaction < 100.0) ? 1 : 0;
@@ -979,15 +979,15 @@ static void
cpustats(void)
{
int state;
- double time;
+ double cptime;
- time = 0.0;
+ cptime = 0.0;
for (state = 0; state < CPUSTATES; ++state)
- time += cur.cp_time[state];
+ cptime += cur.cp_time[state];
for (state = 0; state < CPUSTATES; ++state)
printf(" %2.0f",
- rint(100. * cur.cp_time[state] / (time ? time : 1)));
+ rint(100. * cur.cp_time[state] / (cptime ? cptime : 1)));
}
static int
OpenPOWER on IntegriCloud