diff options
author | Toomas Soome <tsoome@me.com> | 2022-11-02 12:36:15 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2022-11-08 15:44:39 +0200 |
commit | ab4969f8ab0fdee71bced8aced6cd4db6cbed1ca (patch) | |
tree | 01a203dc2efcc754da772057c613c68ef929d459 /usr/src/boot/common/module.c | |
parent | d56b5f9f1e06794379c22afb6e6ba0ac704e4214 (diff) | |
download | illumos-joyent-ab4969f8ab0fdee71bced8aced6cd4db6cbed1ca.tar.gz |
15139 loader: avoid duplicate load for environment and console-font
Reviewed by: Andy Stormont <andyjstormont@gmail.com>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
Diffstat (limited to 'usr/src/boot/common/module.c')
-rw-r--r-- | usr/src/boot/common/module.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr/src/boot/common/module.c b/usr/src/boot/common/module.c index 481c07eb58..df4a2d0744 100644 --- a/usr/src/boot/common/module.c +++ b/usr/src/boot/common/module.c @@ -458,12 +458,17 @@ build_environment_module(void) vm_offset_t laddr; /* We can't load first */ - if ((file_findfile(NULL, NULL)) == NULL) { + if (file_findfile(NULL, NULL) == NULL) { printf("Can not load environment module: %s\n", "the kernel is not loaded"); return; } + if (file_findfile(name, name) != NULL) { + printf("warning: '%s' is already loaded\n", name); + return; + } + tem_save_state(); /* Ask tem to save it's state in env. */ size = env_get_size(); @@ -522,12 +527,17 @@ build_font_module(void) return; /* We can't load first */ - if ((file_findfile(NULL, NULL)) == NULL) { + if (file_findfile(NULL, NULL) == NULL) { printf("Can not load font module: %s\n", "the kernel is not loaded"); return; } + if (file_findfile(name, name) != NULL) { + printf("warning: '%s' is already loaded\n", name); + return; + } + /* helper pointers */ bd = NULL; STAILQ_FOREACH(fl, &fonts, font_next) { |