When creating new device nodes based on the major number of the LKM slot we

have been assigned, try to remove any existing ones first; otherwise loading
the LKM could fail with EEXIST.  Fixes PR kern/3868.

Why was this call dropped between v3-2alpha7 and v3-2beta1?
This commit is contained in:
kleink 1997-07-19 22:42:18 +00:00
parent f8ce8a3693
commit 20b33f1d4c

View File

@ -1,4 +1,4 @@
/* $NetBSD: mln_ipl.c,v 1.14 1997/07/19 15:35:27 kleink Exp $ */
/* $NetBSD: mln_ipl.c,v 1.15 1997/07/19 22:42:18 kleink Exp $ */
/*
* (C)opyright 1993,1994,1995 by Darren Reed.
@ -208,6 +208,13 @@ ipl_load()
int error = 0, fmode = S_IFCHR|0600, i;
char *name;
/*
* XXX Remove existing device nodes prior to creating new ones
* XXX using the assigned LKM device slot's major number. In a
* XXX perfect world we could use the ones specified by cdevsw[].
*/
(void)ipl_remove();
for (i = 0; (name = ipf_devfiles[i]); i++) {
NDINIT(&nd, CREATE, LOCKPARENT, UIO_SYSSPACE, name, curproc);
if ((error = namei(&nd)))