summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--toolbox/rmmod.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/toolbox/rmmod.c b/toolbox/rmmod.c
index 25257cc39..c7e0d6ac7 100644
--- a/toolbox/rmmod.c
+++ b/toolbox/rmmod.c
@@ -10,7 +10,7 @@ extern int delete_module(const char *, unsigned int);
10 10
11int rmmod_main(int argc, char **argv) 11int rmmod_main(int argc, char **argv)
12{ 12{
13 int ret; 13 int ret, i;
14 char *modname, *dot; 14 char *modname, *dot;
15 15
16 /* make sure we've got an argument */ 16 /* make sure we've got an argument */
@@ -31,6 +31,15 @@ int rmmod_main(int argc, char **argv)
31 if (dot) 31 if (dot)
32 *dot = '\0'; 32 *dot = '\0';
33 33
34 /* Replace "-" with "_". This would keep rmmod
35 * compatible with module-init-tools version of
36 * rmmod
37 */
38 for (i = 0; modname[i] != '\0'; i++) {
39 if (modname[i] == '-')
40 modname[i] = '_';
41 }
42
34 /* pass it to the kernel */ 43 /* pass it to the kernel */
35 ret = delete_module(modname, O_NONBLOCK | O_EXCL); 44 ret = delete_module(modname, O_NONBLOCK | O_EXCL);
36 if (ret != 0) { 45 if (ret != 0) {