diff options
author | Guillem Jover <guillem@debian.org> | 2014-10-03 04:52:04 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2014-10-06 00:47:55 +0200 |
commit | 8fbe533b5b335ca08c0478687ea30a9a96f3fc6a (patch) | |
tree | 0f8f762f1261c33bb25bda889db65d29a0d69459 /utils/start-stop-daemon.c | |
parent | c0817d3bcf59fa88c655c730a56285d52342aba4 (diff) | |
download | dpkg-8fbe533b5b335ca08c0478687ea30a9a96f3fc6a.tar.gz |
s-s-d: On kFreeBSD do not make kvm_openfiles() open /dev/mem
We do not need that file, as we are not using any kvm_read(3) call,
either explicitly or implicitly. Everything is retrieved through
sysctl(2).
libkvm from FreeBSD allows to pass /dev/null as the memory file to
denote that we do not need it.
This will make s-s-d work again on jails which do not usually have
/dev/mem available.
Reported-by: Steven Chamberlain <steven@pyro.eu.org>
Diffstat (limited to 'utils/start-stop-daemon.c')
-rw-r--r-- | utils/start-stop-daemon.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index 100c55562..64a631a7e 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -103,6 +103,11 @@ #ifdef HAVE_KVM_H #include <kvm.h> +#if defined(OSFreeBSD) +#define KVM_MEMFILE "/dev/null" +#else +#define KVM_MEMFILE NULL +#endif #endif #ifdef _POSIX_PRIORITY_SCHEDULING @@ -1229,7 +1234,7 @@ ssd_kvm_open(void) kvm_t *kd; char errbuf[_POSIX2_LINE_MAX]; - kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, errbuf); + kd = kvm_openfiles(NULL, KVM_MEMFILE, NULL, O_RDONLY, errbuf); if (kd == NULL) errx(1, "%s", errbuf); |