• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

system/core


Commit MetaInfo

Révision79d3289284b5d51fb28c2d3546d998212cb6b92c (tree)
l'heure2012-07-11 16:36:30
AuteurVishal Bhoj <vishal.bhoj@lina...>
CommiterChih-Wei Huang

Message de Log

toolbox: rmmod: fix module unloading

Replace "-" with "_" in module name. This would keep
rmmod compatible with module-init-tools version of rmmod

Change-Id: I4470d9a98bc2f299acd94859fca4403aee279d2b
Signed-off-by: Vishal Bhoj <vishal.bhoj@linaro.org>

Change Summary

Modification

--- a/toolbox/rmmod.c
+++ b/toolbox/rmmod.c
@@ -10,7 +10,7 @@ extern int delete_module(const char *, unsigned int);
1010
1111 int rmmod_main(int argc, char **argv)
1212 {
13- int ret;
13+ int ret, i;
1414 char *modname, *dot;
1515
1616 /* make sure we've got an argument */
@@ -29,6 +29,15 @@ int rmmod_main(int argc, char **argv)
2929 if (dot)
3030 *dot = '\0';
3131
32+ /* Replace "-" with "_". This would keep rmmod
33+ * compatible with module-init-tools version of
34+ * rmmod
35+ */
36+ for (i = 0; modname[i] != '\0'; i++) {
37+ if (modname[i] == '-')
38+ modname[i] = '_';
39+ }
40+
3241 /* pass it to the kernel */
3342 ret = delete_module(modname, O_NONBLOCK | O_EXCL);
3443 if (ret != 0) {