diff options
| author | Jean-Baptiste Queru <jbq@google.com> | 2012-06-11 15:16:06 -0700 |
|---|---|---|
| committer | android code review <noreply-gerritcodereview@google.com> | 2012-06-11 15:16:07 -0700 |
| commit | 91e5551f88aea5aa64e1b4f8b4b52d7be2b28b64 (patch) | |
| tree | c077fc3d65939daf94362ceadc2451f5ba2d3c42 | |
| parent | ff856a2b927aaadb189181d2cd9dd08dc98456a4 (diff) | |
| parent | fc26c0ba59ab1f74251fb95de2ee6837035e74e4 (diff) | |
| download | system_core-91e5551f88aea5aa64e1b4f8b4b52d7be2b28b64.zip system_core-91e5551f88aea5aa64e1b4f8b4b52d7be2b28b64.tar.gz system_core-91e5551f88aea5aa64e1b4f8b4b52d7be2b28b64.tar.bz2 | |
Merge "toolbox: rmmod: fix module unloading"
| -rw-r--r-- | toolbox/rmmod.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/toolbox/rmmod.c b/toolbox/rmmod.c index 25257cc..c7e0d6a 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) { |
