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

Don't make_dev() in bpfopen() unless we need to.

This commit is contained in:
Poul-Henning Kamp 2000-10-09 14:19:09 +00:00
parent 8abea41d80
commit 6ab7b8286d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=66878

View File

@ -363,8 +363,9 @@ bpfopen(dev, flags, fmt, p)
*/
if (d)
return (EBUSY);
make_dev(&bpf_cdevsw, minor(dev), UID_ROOT, GID_WHEEL, 0600,
"bpf%d", dev2unit(dev));
if (!dev->si_flags & SI_NAMED)
make_dev(&bpf_cdevsw, minor(dev), UID_ROOT, GID_WHEEL, 0600,
"bpf%d", dev2unit(dev));
MALLOC(d, struct bpf_d *, sizeof(*d), M_BPF, M_WAITOK);
bzero(d, sizeof(*d));
dev->si_drv1 = d;