1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00

Rename command_unload() to unload() and re-implement command_unload()

in terms of unload() This allows unloading all files by the loader
itself.

Obtained from:	Juniper Networks, Inc.
This commit is contained in:
Marcel Moolenaar 2014-08-06 00:06:25 +00:00
parent 49b3fc4062
commit ca0a6da1a2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=269618
2 changed files with 13 additions and 6 deletions

View File

@ -229,6 +229,7 @@ extern struct preloaded_file *preloaded_files;
int mod_load(char *name, struct mod_depend *verinfo, int argc, char *argv[]);
int mod_loadkld(const char *name, int argc, char *argv[]);
void unload(void);
struct preloaded_file *file_alloc(void);
struct preloaded_file *file_findfile(char *name, char *type);

View File

@ -192,13 +192,11 @@ command_load_geli(int argc, char *argv[])
return(file_loadraw(argv[2], typestr) ? CMD_OK : CMD_ERROR);
}
COMMAND_SET(unload, "unload", "unload all modules", command_unload);
static int
command_unload(int argc, char *argv[])
void
unload(void)
{
struct preloaded_file *fp;
struct preloaded_file *fp;
while (preloaded_files != NULL) {
fp = preloaded_files;
preloaded_files = preloaded_files->f_next;
@ -206,6 +204,14 @@ command_unload(int argc, char *argv[])
}
loadaddr = 0;
unsetenv("kernelname");
}
COMMAND_SET(unload, "unload", "unload all modules", command_unload);
static int
command_unload(int argc, char *argv[])
{
unload();
return(CMD_OK);
}