diff options
author | trociny <trociny@FreeBSD.org> | 2012-01-25 20:13:37 +0000 |
---|---|---|
committer | trociny <trociny@FreeBSD.org> | 2012-01-25 20:13:37 +0000 |
commit | 4399303fd6414fe250c01e8cf5bc75bd1f1f8e00 (patch) | |
tree | c32894cc56d96e55f992a5175f056468cb670d03 /usr.bin | |
parent | 768a468c15a95c443b29381081ac318debea4846 (diff) | |
download | FreeBSD-src-4399303fd6414fe250c01e8cf5bc75bd1f1f8e00.zip FreeBSD-src-4399303fd6414fe250c01e8cf5bc75bd1f1f8e00.tar.gz |
After the recent changes there is no need in rlimit array any more.
Submitted by: Andrey Zonov <andrey at zonov.org>
MFC after: 1 week
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/procstat/procstat_rlimit.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/procstat/procstat_rlimit.c b/usr.bin/procstat/procstat_rlimit.c index 5f9c5fc..c5429c4 100644 --- a/usr.bin/procstat/procstat_rlimit.c +++ b/usr.bin/procstat/procstat_rlimit.c @@ -66,8 +66,6 @@ static struct { #error "Resource limits have grown. Add new entries to rlimit_param[]." #endif -static struct rlimit rlimit[RLIM_NLIMITS]; - static const char *humanize_rlimit(int indx, rlim_t limit) { @@ -90,6 +88,7 @@ const char *humanize_rlimit(int indx, rlim_t limit) void procstat_rlimit(struct kinfo_proc *kipp) { + struct rlimit rlimit; int error, i, name[5]; size_t len; @@ -104,7 +103,7 @@ procstat_rlimit(struct kinfo_proc *kipp) name[3] = kipp->ki_pid; for (i = 0; i < RLIM_NLIMITS; i++) { name[4] = i; - error = sysctl(name, 5, &rlimit[i], &len, NULL, 0); + error = sysctl(name, 5, &rlimit, &len, NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); return; @@ -114,7 +113,7 @@ procstat_rlimit(struct kinfo_proc *kipp) printf("%5d %-16s %-16s ", kipp->ki_pid, kipp->ki_comm, rlimit_param[i].name); - printf("%16s ", humanize_rlimit(i, rlimit[i].rlim_cur)); - printf("%16s\n", humanize_rlimit(i, rlimit[i].rlim_max)); - } + printf("%16s ", humanize_rlimit(i, rlimit.rlim_cur)); + printf("%16s\n", humanize_rlimit(i, rlimit.rlim_max)); + } } |