diff options
author | Adrien Schildknecht <schild_a@epita.fr> | 2013-09-16 22:14:07 +0200 |
---|---|---|
committer | Adrien Schildknecht <schild_a@epita.fr> | 2013-09-16 22:14:07 +0200 |
commit | 068872e0c86217894513cc380dc8aa7b32fe2f63 (patch) | |
tree | 74db30325fa59258300f9e09ed787f2af2375c8a | |
parent | 47a4a98da72f29e48c4b133e4d0d00a063e242db (diff) |
BSD: include unistd.h (access)
-rw-r--r-- | xcwd.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -8,12 +8,12 @@ #include <stdio.h> #include <string.h> #include <strings.h> +#include <unistd.h> #include <X11/Xlib.h> #ifdef LINUX # include <sys/stat.h> # include <glob.h> -# include <unistd.h> #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; |