diff options
author | dfr <dfr@FreeBSD.org> | 1999-02-20 21:22:00 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 1999-02-20 21:22:00 +0000 |
commit | fffe61ae5b0e63d9fc06f1afbf90e746010d96ce (patch) | |
tree | 7e8fff750ef0a275acb479224f32fd24dbcb0f22 /sys/kern/kern_linker.c | |
parent | 135b579aaa48e0e0fb47d41d30792e8efc241139 (diff) | |
download | FreeBSD-src-fffe61ae5b0e63d9fc06f1afbf90e746010d96ce.zip FreeBSD-src-fffe61ae5b0e63d9fc06f1afbf90e746010d96ce.tar.gz |
A correction to the code which attempts to prevent the same module
being loaded twice. It used rindex() to strip the pathname but failed
to account for the fact that rindex() will return a pointer to the '/',
not the first character of the filename.
Submitted by: Nick Hibma <hibma@skylink.it>
Diffstat (limited to 'sys/kern/kern_linker.c')
-rw-r--r-- | sys/kern/kern_linker.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 399793a..687f66c 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kern_linker.c,v 1.25 1999/01/27 23:45:39 dillon Exp $ + * $Id: kern_linker.c,v 1.26 1999/02/16 10:49:48 dfr Exp $ */ #include "opt_ddb.h" @@ -689,6 +689,8 @@ kldload(struct proc* p, struct kldload_args* uap) modulename = rindex(filename, '/'); if (modulename == NULL) modulename = filename; + else + modulename++; if (linker_find_file_by_name(modulename)) { error = EEXIST; goto out; |