aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-06-11 15:28:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-11 15:28:12 -0700
commit60f3d65c831a40897a942513147039eef20d2149 (patch)
tree1f8d3c6557d7632898a7f9b1837503bfb22727de
parentef9d8d9b0c9bf987e9df788af430bf9ad4f9f6b2 (diff)
parent2a2e10fbb38e4f4d7759f619275fa4ebd596259a (diff)
downloadsystem_core-60f3d65c831a40897a942513147039eef20d2149.tar.gz
system_core-60f3d65c831a40897a942513147039eef20d2149.tar.bz2
system_core-60f3d65c831a40897a942513147039eef20d2149.zip
am 2a2e10fb: am 16d2b6ae: am 91e5551f: Merge "toolbox: rmmod: fix module unloading"
* commit '2a2e10fbb38e4f4d7759f619275fa4ebd596259a': toolbox: rmmod: fix module unloading
-rw-r--r--toolbox/rmmod.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/toolbox/rmmod.c b/toolbox/rmmod.c
index 25257cc3..c7e0d6ac 100644
--- a/toolbox/rmmod.c
+++ b/toolbox/rmmod.c
@@ -10,7 +10,7 @@ extern int delete_module(const char *, unsigned int);
int rmmod_main(int argc, char **argv)
{
- int ret;
+ int ret, i;
char *modname, *dot;
/* make sure we've got an argument */
@@ -31,6 +31,15 @@ int rmmod_main(int argc, char **argv)
if (dot)
*dot = '\0';
+ /* Replace "-" with "_". This would keep rmmod
+ * compatible with module-init-tools version of
+ * rmmod
+ */
+ for (i = 0; modname[i] != '\0'; i++) {
+ if (modname[i] == '-')
+ modname[i] = '_';
+ }
+
/* pass it to the kernel */
ret = delete_module(modname, O_NONBLOCK | O_EXCL);
if (ret != 0) {