binmiscctl should use modfind instead of kldfind
kldfind() only matches kernel modules, so if you link imgact_binmisc directly into the kernel, binmiscctl can't find it, tries to load it, and errors out with: Can't load imgact_binmisc kernel module: File exists A quick search of other base commands shows that the correct procedure is to call modfind(), and then try kldload() if that fails. PR: 218593 Submitted by: Dan Nelson <dnelson_1901@yahoo.com> MFC after: 1 week
This commit is contained in:
parent
d00ed7642f
commit
4b5e2f8ea0
@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/types.h>
|
||||
#include <sys/imgact_binmisc.h>
|
||||
#include <sys/linker.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/sysctl.h>
|
||||
|
||||
enum cmd {
|
||||
@ -401,7 +402,7 @@ main(int argc, char **argv)
|
||||
size_t xbe_out_sz = 0, *xbe_out_szp = NULL;
|
||||
uint32_t i;
|
||||
|
||||
if (kldfind(KMOD_NAME) == -1) {
|
||||
if (modfind(KMOD_NAME) == -1) {
|
||||
if (kldload(KMOD_NAME) == -1)
|
||||
fatal("Can't load %s kernel module: %s",
|
||||
KMOD_NAME, strerror(errno));
|
||||
|
Loading…
Reference in New Issue
Block a user