diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c index 8b4e13c4b7af..0c4bfc1970f8 100644 --- a/sys/alpha/linux/linux_sysvec.c +++ b/sys/alpha/linux/linux_sysvec.c @@ -224,37 +224,39 @@ linux_elf_modevent(module_t mod, int type, void *data) ++brandinfo) if (elf_insert_brand_entry(*brandinfo) < 0) error = EINVAL; - if (error) - printf("cannot insert Linux elf brand handler\n"); - else { - linux_ioctl_register_handlers(&linux_ioctl_handler_set); + if (error == 0) { + linux_ioctl_register_handlers( + &linux_ioctl_handler_set); if (bootverbose) - printf("Linux-ELF exec handler installed\n"); - } + printf("Linux ELF exec handler installed\n"); + } else + printf("cannot insert Linux ELF brand handler\n"); break; case MOD_UNLOAD: - linux_ioctl_unregister_handlers(&linux_ioctl_handler_set); for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo) if (elf_brand_inuse(*brandinfo)) error = EBUSY; - if (error == 0) { for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo) if (elf_remove_brand_entry(*brandinfo) < 0) error = EINVAL; } - if (error) + if (error == 0) { + linux_ioctl_unregister_handlers( + &linux_ioctl_handler_set); + if (bootverbose) + printf("Linux ELF exec handler removed\n"); + } else printf("Could not deinstall ELF interpreter entry\n"); - else if (bootverbose) - printf("Linux-elf exec handler removed\n"); break; default: break; } return error; } + static moduledata_t linux_elf_mod = { "linuxelf", linux_elf_modevent, diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c index d86db5b3c730..e836d02bcffb 100644 --- a/sys/i386/linux/linux_sysvec.c +++ b/sys/i386/linux/linux_sysvec.c @@ -794,40 +794,43 @@ linux_elf_modevent(module_t mod, int type, void *data) ++brandinfo) if (elf_insert_brand_entry(*brandinfo) < 0) error = EINVAL; - if (error) - printf("cannot insert Linux elf brand handler\n"); - else { - linux_ioctl_register_handlers(&linux_ioctl_handler_set); + if (error == 0) { + linux_ioctl_register_handlers( + &linux_ioctl_handler_set); if (bootverbose) - printf("Linux-ELF exec handler installed\n"); - } + printf("Linux ELF exec handler installed\n"); + } else + printf("cannot insert Linux ELF brand handler\n"); break; case MOD_UNLOAD: - linux_ioctl_unregister_handlers(&linux_ioctl_handler_set); for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo) if (elf_brand_inuse(*brandinfo)) error = EBUSY; - if (error == 0) { for (brandinfo = &linux_brandlist[0]; *brandinfo != NULL; ++brandinfo) if (elf_remove_brand_entry(*brandinfo) < 0) error = EINVAL; } - if (error) + if (error == 0) { + linux_ioctl_unregister_handlers( + &linux_ioctl_handler_set); + if (bootverbose) + printf("Linux ELF exec handler removed\n"); + } else printf("Could not deinstall ELF interpreter entry\n"); - else if (bootverbose) - printf("Linux-elf exec handler removed\n"); break; default: break; } return error; } + static moduledata_t linux_elf_mod = { "linuxelf", linux_elf_modevent, 0 }; + DECLARE_MODULE(linuxelf, linux_elf_mod, SI_SUB_EXEC, SI_ORDER_ANY);