summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2003-09-07 06:46:30 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-09-07 06:46:30 -0700
commiteddef4feb4369777e379668756cefa4bf2bcf43c (patch)
tree85dc84a9aacb62c67c2c7fa628bc8910fd5fb00a
parent4cf01742c63c1184f6879d0ad92092e7b6464689 (diff)
[PATCH] modprobe -q: quieter when modules missing
The kernel invokes "modprobe" on modules which might not exist: rightfully, modprobe complains by default when this happens. So the correct response is to invoke "modprobe -q", which is silent on such errors (but still reports other errors such as config errors). Also, use MODULE_NAME_LEN from module.h instead of inventing our own.
-rw-r--r--kernel/kmod.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/kmod.c b/kernel/kmod.c
index e011611afb7d..98d809689092 100644
--- a/kernel/kmod.c
+++ b/kernel/kmod.c
@@ -60,12 +60,11 @@ char modprobe_path[256] = "/sbin/modprobe";
*/
int request_module(const char *fmt, ...)
{
-#define MODULENAME_SIZE 32
va_list args;
- char module_name[MODULENAME_SIZE];
+ char module_name[MODULE_NAME_LEN];
unsigned int max_modprobes;
int ret;
- char *argv[] = { modprobe_path, "--", module_name, NULL };
+ char *argv[] = { modprobe_path, "-q", "--", module_name, NULL };
static char *envp[] = { "HOME=/",
"TERM=linux",
"PATH=/sbin:/usr/sbin:/bin:/usr/bin",
@@ -75,9 +74,9 @@ int request_module(const char *fmt, ...)
static int kmod_loop_msg;
va_start(args, fmt);
- ret = vsnprintf(module_name, MODULENAME_SIZE, fmt, args);
+ ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
va_end(args);
- if (ret >= MODULENAME_SIZE)
+ if (ret >= MODULE_NAME_LEN)
return -ENAMETOOLONG;
/* If modprobe needs a service that is in a module, we get a recursive