diff --git a/xcwd.c b/xcwd.c index 4cabf83..52132f0 100644 --- a/xcwd.c +++ b/xcwd.c @@ -8,12 +8,12 @@ #include #include #include +#include #include #ifdef LINUX # include # include -# include #endif #ifdef BSD @@ -189,10 +189,9 @@ static processes_t getProcesses(void) struct kinfo_proc *kp; size_t len = 0; int name[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PROC, 0 }; - int error; - error = sysctl(name, 4, NULL, &len, NULL, 0); + sysctl(name, 4, NULL, &len, NULL, 0); kp = malloc(len); - error = sysctl(name, 4, kp, &len, NULL, 0); + sysctl(name, 4, kp, &len, NULL, 0); count = len / sizeof(*kp); p->ps = calloc(count, sizeof(struct proc_s)); p->n = count;