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

This commit is contained in:
phk 2000-10-09 14:19:09 +00:00
parent 0cde68d5f5
commit 3f39ed6279

View File

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