diff options
author | marcel <marcel@FreeBSD.org> | 2000-11-23 03:21:58 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2000-11-23 03:21:58 +0000 |
commit | 9e0bf67c894303a9461c8a5fbd3988cccfae20f9 (patch) | |
tree | d3c1e3cb56f5c2599c674f5690f0dc8a8b8ba41f /sys/alpha/linux/linux_sysvec.c | |
parent | 45350b13e38116f39f64d45bd96c672f3a931f87 (diff) | |
download | FreeBSD-src-9e0bf67c894303a9461c8a5fbd3988cccfae20f9.zip FreeBSD-src-9e0bf67c894303a9461c8a5fbd3988cccfae20f9.tar.gz |
Don't unregister the ioctl handlers before we verified we
can unload. Doing so leaves the linuxulator in a crippled
state (no ioctl support) when Linux binaries are run at
unload time.
While here, consistently spell ELF in capitals and perform
some minor style improvements.
ELF spelling submitted by: asmodai
Diffstat (limited to 'sys/alpha/linux/linux_sysvec.c')
-rw-r--r-- | sys/alpha/linux/linux_sysvec.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/alpha/linux/linux_sysvec.c b/sys/alpha/linux/linux_sysvec.c index 8b4e13c..0c4bfc1 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, |