diff options
| author | Alexander Langer <alex@FreeBSD.org> | 1998-10-11 21:08:02 +0000 |
|---|---|---|
| committer | Alexander Langer <alex@FreeBSD.org> | 1998-10-11 21:08:02 +0000 |
| commit | 514058dc0d1dd4d27f9f6adbe0afd8d8a9b3e211 (patch) | |
| tree | 31fa7a3c40d47cca9c9ad6066477f7c629c232e2 /sys/modules | |
| parent | 9836a38f7b26c037724fe539901251dc9d862668 (diff) | |
Notes
Diffstat (limited to 'sys/modules')
| -rw-r--r-- | sys/modules/linux/linux.c | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sys/modules/linux/linux.c b/sys/modules/linux/linux.c index 11898c3121fe..b3da352d26d3 100644 --- a/sys/modules/linux/linux.c +++ b/sys/modules/linux/linux.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: linux.c,v 1.12 1997/05/01 06:08:14 jkh Exp $ + * $Id: linux.c,v 1.13 1998/09/17 22:08:34 msmith Exp $ */ #include <sys/param.h> @@ -41,14 +41,22 @@ extern const struct execsw linux_execsw; MOD_EXEC(linux, -1, &linux_execsw); -extern Elf32_Brandinfo linux_brand, linux_glibc2brand; +extern Elf32_Brandinfo *linux_brandlist[]; static int linux_load(struct lkm_table *lkmtp, int cmd) { - if ((elf_insert_brand_entry(&linux_brand)) || - (elf_insert_brand_entry(&linux_glibc2brand))) - uprintf("Could not install ELF interpreter entry\n"); + Elf32_Brandinfo **brandinfo; + int error; + + error = 0; + + for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo) + if (elf_insert_brand_entry(*brandinfo) < 0) + error = 1; + + if (error) + printf("Could not install ELF interpreter entry\n"); /* uprintf("Linux emulator installed\n"); XXX - shut up, you! */ return 0; } @@ -56,7 +64,16 @@ linux_load(struct lkm_table *lkmtp, int cmd) static int linux_unload(struct lkm_table *lkmtp, int cmd) { - if (elf_remove_brand_entry(&linux_brand)) + Elf32_Brandinfo **brandinfo; + int error; + + error = 0; + + for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo) + if (elf_remove_brand_entry(*brandinfo) < 0) + error = 1; + + if (error) uprintf("Could not deinstall ELF interpreter entry\n"); uprintf("Linux emulator removed\n"); return 0; |
