diff options
author | Stefan Bucur <stefanb@zytor.com> | 2008-08-16 15:47:39 +0300 |
---|---|---|
committer | Stefan Bucur <stefan@stefan-ubumac.(none)> | 2009-03-15 10:12:28 +0200 |
commit | 1b8e1bcc64ad1a4937fc3c69c412a7762280aa4a (patch) | |
tree | b56ce3c0522b46e42ac2935476d6ac222282fb0c /com32/lib/sys/module/common.c | |
parent | 22d8571631b3f14f4726d9086c895e31eab866d9 (diff) | |
download | syslinux-elf-1b8e1bcc64ad1a4937fc3c69c412a7762280aa4a.tar.gz syslinux-elf-1b8e1bcc64ad1a4937fc3c69c412a7762280aa4a.tar.xz syslinux-elf-1b8e1bcc64ad1a4937fc3c69c412a7762280aa4a.zip |
Implemented the 'list' command in the CLI.
Diffstat (limited to 'com32/lib/sys/module/common.c')
-rw-r--r-- | com32/lib/sys/module/common.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c index 9934a7a4..387dc1a3 100644 --- a/com32/lib/sys/module/common.c +++ b/com32/lib/sys/module/common.c @@ -316,12 +316,19 @@ int check_symbols(struct elf_module *module) { return 0; } +int module_unloadable(struct elf_module *module) { + if (!list_empty(&module->dependants)) + return 0; + + return 1; +} + // Unloads the module from the system and releases all the associated memory int module_unload(struct elf_module *module) { struct module_dep *crt_dep, *tmp; // Make sure nobody needs us - if (!list_empty(&module->dependants)) { + if (!module_unloadable(module)) { DBG_PRINT("Module is required by other modules.\n"); return -1; } |