1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-11 09:50:12 +00:00

Check to see if the devfs MIB exists and return 1 if it exists rather

than making device node(s).
Submitted by:	Hiroo ONO <hiroo@oikumene.gcd.org>
This commit is contained in:
Jordan K. Hubbard 2001-10-10 07:46:04 +00:00
parent 4546f9029c
commit ac68d688b1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84748

View File

@ -22,6 +22,7 @@ __FBSDID("$FreeBSD$");
#include <sys/diskslice.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <grp.h>
#include <paths.h>
#include <pwd.h>
@ -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;