From 068872e0c86217894513cc380dc8aa7b32fe2f63 Mon Sep 17 00:00:00 2001 From: Adrien Schildknecht Date: Mon, 16 Sep 2013 22:14:07 +0200 Subject: [PATCH] BSD: include unistd.h (access) --- xcwd.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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;