aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/librc/librc-daemon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librc/librc-daemon.c b/src/librc/librc-daemon.c
index e6641410..938448d1 100644
--- a/src/librc/librc-daemon.c
+++ b/src/librc/librc-daemon.c
@@ -194,6 +194,7 @@ librc_hidden_def(rc_find_pids)
# define _GET_KINFO_COMM(kp) (kp.ki_comm)
# 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
@@ -202,6 +203,7 @@ librc_hidden_def(rc_find_pids)
# 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,
@@ -221,7 +223,7 @@ pid_t *rc_find_pids (const char *const *argv, const char *cmd,
int match;
if ((kd = kvm_openfiles (_KVM_PATH, _KVM_PATH,
- NULL, O_RDONLY, errbuf)) == NULL)
+ NULL, _KVM_FLAGS, errbuf)) == NULL)
{
fprintf (stderr, "kvm_open: %s\n", errbuf);
return (NULL);