diff options
author | phk <phk@FreeBSD.org> | 2003-09-27 21:50:00 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-09-27 21:50:00 +0000 |
commit | d0dceae232c439e34b42bed2045241fb1ebcbfa0 (patch) | |
tree | 7697bfcd65032a030f976139cbb0b64bc0939f78 | |
parent | 9ac5ba861632606cf8c664b4c2073bb01bdd27d1 (diff) | |
download | FreeBSD-src-d0dceae232c439e34b42bed2045241fb1ebcbfa0.zip FreeBSD-src-d0dceae232c439e34b42bed2045241fb1ebcbfa0.tar.gz |
Make life a little bit easier for cloning device drivers.
-rw-r--r-- | sys/kern/kern_conf.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c index d578077..4d8e74b 100644 --- a/sys/kern/kern_conf.c +++ b/sys/kern/kern_conf.c @@ -375,6 +375,15 @@ make_dev(struct cdevsw *devsw, int minor, uid_t uid, gid_t gid, int perms, const } dev = makedev(devsw->d_maj, minor); + if (dev->si_flags & SI_CHEAPCLONE && + dev->si_flags & SI_NAMED && + dev->si_devsw == devsw) { + /* + * This is allowed as it removes races and generally + * simplifies cloning devices. + */ + return (dev); + } if (dev->si_flags & SI_NAMED) { printf( "WARNING: Driver mistake: repeat make_dev(\"%s\")\n", dev->si_name); |