diff options
| author | Mikolaj Golub <trociny@FreeBSD.org> | 2012-01-29 20:39:42 +0000 |
|---|---|---|
| committer | Mikolaj Golub <trociny@FreeBSD.org> | 2012-01-29 20:39:42 +0000 |
| commit | 8d2393a033db19750854436a6403f97615f4d4ec (patch) | |
| tree | 244f0688ef060c0d0c3abdeb7f965e168e63ec10 /usr.bin/procstat | |
| parent | dfdcd4c7336cc213f46e131444a9104a6764793b (diff) | |
Notes
Diffstat (limited to 'usr.bin/procstat')
| -rw-r--r-- | usr.bin/procstat/procstat_auxv.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/procstat/procstat_auxv.c b/usr.bin/procstat/procstat_auxv.c index 73a85cd840d5..9bf7afb0804b 100644 --- a/usr.bin/procstat/procstat_auxv.c +++ b/usr.bin/procstat/procstat_auxv.c @@ -81,7 +81,7 @@ is_elf32(pid_t pid) static size_t retrieve_auxv32(pid_t pid) { - int error, name[4]; + int name[4]; size_t len, i; void *ptr; @@ -90,9 +90,9 @@ retrieve_auxv32(pid_t pid) name[2] = KERN_PROC_AUXV; name[3] = pid; len = sizeof(auxv32); - error = sysctl(name, 4, auxv32, &len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM) { - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + if (sysctl(name, 4, auxv32, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); return (0); } for (i = 0; i < len; i++) { @@ -117,7 +117,7 @@ retrieve_auxv32(pid_t pid) static size_t retrieve_auxv(pid_t pid) { - int error, name[4]; + int name[4]; size_t len; #if __ELF_WORD_SIZE == 64 @@ -129,9 +129,9 @@ retrieve_auxv(pid_t pid) name[2] = KERN_PROC_AUXV; name[3] = pid; len = sizeof(auxv); - error = sysctl(name, 4, auxv, &len, NULL, 0); - if (error < 0 && errno != ESRCH && errno != EPERM) { - warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); + if (sysctl(name, 4, auxv, &len, NULL, 0) == -1) { + if (errno != ESRCH && errno != EPERM) + warn("sysctl: kern.proc.auxv: %d: %d", pid, errno); return (0); } return (len); |
