Allow for passing more than one module at a time:

$ sudo modunload auvitek xc5000 wintv_eeprom
This commit is contained in:
jmcneill 2010-12-06 23:42:48 +00:00
parent 0139c9e7c5
commit ed7bfdfad4
2 changed files with 12 additions and 8 deletions

View File

@ -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 @@ static void usage(void) __dead;
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 @@ static void
usage(void)
{
(void)fprintf(stderr, "Usage: %s <module_name>\n", getprogname());
(void)fprintf(stderr, "Usage: %s <module_name ...>\n", getprogname());
exit(EXIT_FAILURE);
}

View File

@ -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