Module Name:    src
Committed By:   jmcneill
Date:           Mon Dec  6 23:42:48 UTC 2010

Modified Files:
        src/sbin/modunload: main.c modunload.8

Log Message:
Allow for passing more than one module at a time:

  $ sudo modunload auvitek xc5000 wintv_eeprom


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/modunload/main.c
cvs rdiff -u -r1.17 -r1.18 src/sbin/modunload/modunload.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/modunload/main.c
diff -u src/sbin/modunload/main.c:1.2 src/sbin/modunload/main.c:1.3
--- src/sbin/modunload/main.c:1.2	Mon Apr 28 20:23:09 2008
+++ src/sbin/modunload/main.c	Mon Dec  6 23:42:48 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.2 2008/04/28 20:23:09 martin Exp $	*/
+/*	$NetBSD: main.c,v 1.3 2010/12/06 23:42:48 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.2 2008/04/28 20:23:09 martin Exp $");
+__RCSID("$NetBSD: main.c,v 1.3 2010/12/06 23:42:48 jmcneill Exp $");
 #endif /* !lint */
 
 #include <sys/module.h>
@@ -45,12 +45,15 @@
 int
 main(int argc, char **argv)
 {
+	int i;
 
-	if (argc != 2)
+	if (argc < 2)
 		usage();
 
-	if (modctl(MODCTL_UNLOAD, argv[1])) {
-		err(EXIT_FAILURE, NULL);
+	for (i = 1; i < argc; i++) {
+		if (modctl(MODCTL_UNLOAD, argv[i])) {
+			err(EXIT_FAILURE, NULL);
+		}
 	}
 
 	exit(EXIT_SUCCESS);
@@ -60,6 +63,6 @@
 usage(void)
 {
 
-	(void)fprintf(stderr, "Usage: %s <module_name>\n", getprogname());
+	(void)fprintf(stderr, "Usage: %s <module_name ...>\n", getprogname());
 	exit(EXIT_FAILURE);
 }

Index: src/sbin/modunload/modunload.8
diff -u src/sbin/modunload/modunload.8:1.17 src/sbin/modunload/modunload.8:1.18
--- src/sbin/modunload/modunload.8:1.17	Fri Mar  5 18:51:23 2010
+++ src/sbin/modunload/modunload.8	Mon Dec  6 23:42:48 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: modunload.8,v 1.17 2010/03/05 18:51:23 pooka Exp $
+.\" $NetBSD: modunload.8,v 1.18 2010/12/06 23:42:48 jmcneill Exp $
 .\"
 .\" Copyright (c) 1993 Christopher G. Demetriou
 .\" All rights reserved.
@@ -32,7 +32,7 @@
 .\"
 .\" <<Id: LICENSE,v 1.2 2000/06/14 15:57:33 cgd Exp>>
 .\"
-.Dd March 5, 2010
+.Dd December 6, 2010
 .Dt MODUNLOAD 8
 .Os
 .Sh NAME
@@ -41,6 +41,7 @@
 .Sh SYNOPSIS
 .Nm
 .Ar name
+\&...
 .Sh DESCRIPTION
 The
 .Nm

Reply via email to