From 54afc10aa481fbb50ec8968b317e5d4d2db0d23f Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Mon, 3 Mar 2008 19:55:29 +0000 Subject: Sanitise the BSD defines a little. --- src/librc/librc-daemon.c | 20 ++++++++++---------- src/librc/librc.h | 3 +-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c index 938448d1..ca23ed27 100644 --- a/src/librc/librc-daemon.c +++ b/src/librc/librc-daemon.c @@ -184,7 +184,16 @@ librc_hidden_def(rc_find_pids) #elif BSD -# if defined(__DragonFly__) || defined(__FreeBSD__) +# if defined(__NetBSD__) || defined(__OpenBSD__) +# define _KVM_GETPROC2 +# define _KINFO_PROC kinfo_proc2 +# define _KVM_GETARGV kvm_getargv2 +# define _GET_KINFO_UID(kp) (kp.p_ruid) +# define _GET_KINFO_COMM(kp) (kp.p_comm) +# define _GET_KINFO_PID(kp) (kp.p_pid) +# define _KVM_PATH NULL +# define _KVM_FLAGS KVM_NO_FILES +# else # ifndef KERN_PROC_PROC # define KERN_PROC_PROC KERN_PROC_ALL # endif @@ -195,15 +204,6 @@ librc_hidden_def(rc_find_pids) # define _GET_KINFO_PID(kp) (kp.ki_pid) # define _KVM_PATH _PATH_DEVNULL # define _KVM_FLAGS O_RDONLY -# else -# define _KVM_GETPROC2 -# define _KINFO_PROC kinfo_proc2 -# define _KVM_GETARGV kvm_getargv2 -# define _GET_KINFO_UID(kp) (kp.p_ruid) -# define _GET_KINFO_COMM(kp) (kp.p_comm) -# define _GET_KINFO_PID(kp) (kp.p_pid) -# define _KVM_PATH NULL -# define _KVM_FLAGS KVM_NO_FILES # endif pid_t *rc_find_pids (const char *const *argv, const char *cmd, diff --git a/src/librc/librc.h b/src/librc/librc.h index edde94fe..edbebafb 100644 --- a/src/librc/librc.h +++ b/src/librc/librc.h @@ -57,8 +57,7 @@ #include #include -#if defined(__DragonFly__) || defined(__FreeBSD__) || \ - defined(__NetBSD__) || defined (__OpenBSD__) +#ifdef BSD #include #include #include -- cgit v1.2.3