Browse Source

s-s-d: Use 5-argument kvm_getprocs() call form on OpenBSD

Guillem Jover 7 years ago
parent
commit
2283f64a89
2 changed files with 5 additions and 0 deletions
  1. 1 0
      debian/changelog
  2. 4 0
      utils/start-stop-daemon.c

+ 1 - 0
debian/changelog

@@ -8,6 +8,7 @@ dpkg (1.18.23) UNRELEASED; urgency=medium
       Thanks to Thomas Klausner <wiz@NetBSD.org>.
     - Rename err variable to ret in start-stop-daemon as the former is a
       function on BSDs.
+    - Use 5-argument kvm_getprocs() call form on OpenBSD in start-stop-daemon.
   * Perl modules:
     - Do not special case EM_SPARC32PLUS for NetBSD in Dpkg::Shlibs::Objdump,
       the code has been fixed in NetBSD as that situation could not happen.

+ 4 - 0
utils/start-stop-daemon.c

@@ -1356,7 +1356,11 @@ ssd_kvm_get_procs(kvm_t *kd, int op, int arg, int *count)
 		count = &lcount;
 	*count = 0;
 
+#if defined(OS_OpenBSD)
+	kp = kvm_getprocs(kd, op, arg, sizeof(*kp), count);
+#else
 	kp = kvm_getprocs(kd, op, arg, count);
+#endif
 	if (kp == NULL && errno != ESRCH)
 		errx(1, "%s", kvm_geterr(kd));