Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/modunload Allow for passing more than one module at a t...



details:   https://anonhg.NetBSD.org/src/rev/97465a19e133
branches:  trunk
changeset: 759361:97465a19e133
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Mon Dec 06 23:42:48 2010 +0000

description:
Allow for passing more than one module at a time:

  $ sudo modunload auvitek xc5000 wintv_eeprom

diffstat:

 sbin/modunload/main.c      |  15 +++++++++------
 sbin/modunload/modunload.8 |   5 +++--
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (71 lines):

diff -r 06500e71af86 -r 97465a19e133 sbin/modunload/main.c
--- a/sbin/modunload/main.c     Mon Dec 06 23:26:44 2010 +0000
+++ b/sbin/modunload/main.c     Mon Dec 06 23:42:48 2010 +0000
@@ -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);
 }
diff -r 06500e71af86 -r 97465a19e133 sbin/modunload/modunload.8
--- a/sbin/modunload/modunload.8        Mon Dec 06 23:26:44 2010 +0000
+++ b/sbin/modunload/modunload.8        Mon Dec 06 23:42:48 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index