From ac68d688b19e386022aa036cdb069f9424948b40 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Wed, 10 Oct 2001 07:46:04 +0000 Subject: Check to see if the devfs MIB exists and return 1 if it exists rather than making device node(s). Submitted by: Hiroo ONO --- lib/libdisk/create_chunk.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/libdisk') diff --git a/lib/libdisk/create_chunk.c b/lib/libdisk/create_chunk.c index 46a98072ac9c9..f87fc1dfed853 100644 --- a/lib/libdisk/create_chunk.c +++ b/lib/libdisk/create_chunk.c @@ -22,6 +22,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -283,12 +284,20 @@ MakeDev(struct chunk *c1, const char *path) struct passwd *pwd; uid_t owner; gid_t group; + int mib[4]; + size_t miblen; *buf2 = '\0'; + miblen = sizeof(mib)/sizeof(mib[0]); if (isDebug()) msgDebug("MakeDev: Called with %s on path %s\n", p, path); if (!strcmp(p, "X")) return 0; + if (!sysctlnametomib("vfs.devfs.generation", &mib, &miblen)) { + if (isDebug()) + msgDebug("MakeDev: No need to mknod(2) with DEVFS.\n"); + return 1; + } if (!strncmp(p, "ad", 2)) cmaj = 116, p += 2; -- cgit v1.3