aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>2010-03-16 13:55:27 +0000
committerAlan Jenkins <alan-jenkins@tuffmail.co.uk>2010-03-17 10:24:58 +0000
commit3e71c4c3919c3f38ad652f419e032572694ee4cb (patch)
tree27237d11cb09f277f5095c08b27da0dd81bf38f8
parented058af3b963c5cf404b8a589d0a3058cf8b9b28 (diff)
downloadmodule-init-tools-3e71c4c3919c3f38ad652f419e032572694ee4cb.tar.gz
modprobe: --dump-modversions takes one filename only
[--all would have worked, but that wasn't documented as a feature] Fix the documentation. Move the code out of the top-level loop. This also makes the next commit easier.
-rw-r--r--doc/modprobe.sgml2
-rw-r--r--modprobe.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/doc/modprobe.sgml b/doc/modprobe.sgml
index dcccc7f..85330e1 100644
--- a/doc/modprobe.sgml
+++ b/doc/modprobe.sgml
@@ -60,7 +60,7 @@
</cmdsynopsis>
<cmdsynopsis>
<command>modprobe</command>
- <arg>--dump-modversions</arg> <arg rep='repeat'><replaceable>filename</replaceable></arg>
+ <arg>--dump-modversions</arg> <arg><replaceable>filename</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
diff --git a/modprobe.c b/modprobe.c
index b4424ed..74e7d3a 100644
--- a/modprobe.c
+++ b/modprobe.c
@@ -1828,6 +1828,11 @@ int main(int argc, char *argv[])
if (type)
fatal("-t only supported with -l");
+ if (dump_modver) {
+ dump_modversions(argv[optind], error);
+ goto out;
+ }
+
/* Read aliases, options etc. */
parse_toplevel_config(configname, &conf, dump_config, flags & mit_remove);
@@ -1859,12 +1864,8 @@ int main(int argc, char *argv[])
for (i = 0; i < num_modules; i++) {
char *modname = argv[optind + i];
- if (dump_modver)
- dump_modversions(modname, error);
- else
- failed |= do_modprobe(modname, cmdline_opts,
- &conf, dirname, error, flags);
-
+ failed |= do_modprobe(modname, cmdline_opts,
+ &conf, dirname, error, flags);
}
out: