diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2010-03-16 13:55:27 +0000 |
---|---|---|
committer | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2010-03-17 10:24:58 +0000 |
commit | 3e71c4c3919c3f38ad652f419e032572694ee4cb (patch) | |
tree | 27237d11cb09f277f5095c08b27da0dd81bf38f8 | |
parent | ed058af3b963c5cf404b8a589d0a3058cf8b9b28 (diff) | |
download | module-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.sgml | 2 | ||||
-rw-r--r-- | modprobe.c | 13 |
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> @@ -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: |