Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Explicit which syscall fails in case procctl returns EINVAL
Baptiste Daroussin committed 11 years ago
commit be63cc9367adbf50ef8badbc3323a10efe7b4b38
parent 45736d4
1 file changed +4 -1
modified libpkg/scripts.c
@@ -209,8 +209,11 @@ cleanup:
	if (info.rs_children != 0) {
		killemall.rk_sig = SIGKILL;
		killemall.rk_flags = 0;
-
		if (procctl(P_PID, getpid(), PROC_REAP_KILL, &killemall) != 0)
+
		if (procctl(P_PID, getpid(), PROC_REAP_KILL, &killemall) != 0) {
			pkg_emit_error("Fail to kill children of the scripts");
+
			if (errno == EINVAL)
+
				pkg_emit_errno("procctl", "PROC_REAP_ACQUIRE");
+
		}
	}
	procctl(P_PID, getpid(), PROC_REAP_RELEASE, NULL);
#endif