aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/kldload
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2002-10-08 09:57:03 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2002-10-08 09:57:03 +0000
commitd06c7584b69cf86bb8d455e58364262d30e3a044 (patch)
tree2124d24530d4ca92c46602336ff73627517f09c8 /sbin/kldload
parenta201162d7127a158118c6aa4eb442885c91d8218 (diff)
downloadsrc-d06c7584b69cf86bb8d455e58364262d30e3a044.tar.gz
src-d06c7584b69cf86bb8d455e58364262d30e3a044.zip
Make it possible to kldload(8) many modules.
MFC after: 2 months Sponsored by: Bright Path Solutions Reviewed by: tjr
Notes
Notes: svn path=/head/; revision=104669
Diffstat (limited to 'sbin/kldload')
-rw-r--r--sbin/kldload/kldload.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/sbin/kldload/kldload.c b/sbin/kldload/kldload.c
index fe324bc617a8..567817abf572 100644
--- a/sbin/kldload/kldload.c
+++ b/sbin/kldload/kldload.c
@@ -47,8 +47,12 @@ int
main(int argc, char** argv)
{
int c;
- int verbose = 0;
+ int errors;
int fileid;
+ int verbose;
+
+ errors = 0;
+ verbose = 0;
while ((c = getopt(argc, argv, "v")) != -1)
switch (c) {
@@ -61,15 +65,19 @@ main(int argc, char** argv)
argc -= optind;
argv += optind;
- if (argc != 1)
+ if (argc == 0)
usage();
- fileid = kldload(argv[0]);
- if (fileid < 0)
- err(1, "can't load %s", argv[0]);
- else
- if (verbose)
- printf("Loaded %s, id=%d\n", argv[0], fileid);
+ while (argc-- != 0) {
+ fileid = kldload(argv[0]);
+ if (fileid < 0) {
+ warn("can't load %s", argv[0]);
+ errors++;
+ } else
+ if (verbose)
+ printf("Loaded %s, id=%d\n", argv[0], fileid);
+ argv++;
+ }
- return 0;
+ return errors ? 1 : 0;
}