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:
parent
49b3fc4062
commit
ca0a6da1a2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=269618
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user