Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge "toolbox: rmmod: fix module unloading"

  • Loading branch information...
commit 91e5551f88aea5aa64e1b4f8b4b52d7be2b28b64 2 parents ff856a2 + fc26c0b
authored android code review committed

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. 11  toolbox/rmmod.c
11  toolbox/rmmod.c
@@ -10,7 +10,7 @@ extern int delete_module(const char *, unsigned int);
10 10
 
11 11
 int rmmod_main(int argc, char **argv)
12 12
 {
13  
-	int ret;
  13
+	int ret, i;
14 14
 	char *modname, *dot;
15 15
 
16 16
 	/* make sure we've got an argument */
@@ -31,6 +31,15 @@ int rmmod_main(int argc, char **argv)
31 31
 	if (dot)
32 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 43
 	/* pass it to the kernel */
35 44
 	ret = delete_module(modname, O_NONBLOCK | O_EXCL);
36 45
 	if (ret != 0) {

0 notes on commit 91e5551

Please sign in to comment.
Something went wrong with that request. Please try again.