From e1684acf38043f70a0150aed3da4084fe9918a73 Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Wed, 14 Jun 2006 03:01:06 +0000 Subject: [PATCH] Unbreak 64-bit architectures. The 3rd argument to kern_kldload() is a pointer to an integer and td->td_retval[0] is of type register_t. On 64-bit architectures register_t is wider than an integer. --- sys/kern/kern_linker.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/kern/kern_linker.c b/sys/kern/kern_linker.c index 23051c4485a9..52eac0f7320e 100644 --- a/sys/kern/kern_linker.c +++ b/sys/kern/kern_linker.c @@ -796,15 +796,17 @@ int kldload(struct thread *td, struct kldload_args *uap) { char *pathname = NULL; - int error; + int error, fileid; td->td_retval[0] = -1; pathname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); error = copyinstr(uap->file, pathname, MAXPATHLEN, NULL); - if (error == 0) - error = kern_kldload(td, pathname, &td->td_retval[0]); - + if (error == 0) { + error = kern_kldload(td, pathname, &fileid); + if (error == 0) + td->td_retval[0] = fileid; + } free(pathname, M_TEMP); return (error); }