diff options
Diffstat (limited to 'sbin/kldunload')
-rw-r--r-- | sbin/kldunload/kldunload.8 | 16 | ||||
-rw-r--r-- | sbin/kldunload/kldunload.c | 25 |
2 files changed, 20 insertions, 21 deletions
diff --git a/sbin/kldunload/kldunload.8 b/sbin/kldunload/kldunload.8 index f9b806c..2273c59 100644 --- a/sbin/kldunload/kldunload.8 +++ b/sbin/kldunload/kldunload.8 @@ -23,11 +23,11 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id$ +.\" $Id: kldunload.8,v 1.1 1997/05/07 18:19:54 dfr Exp $ .\" .Dd April 25, 1997 .Dt KLDUNLOAD 8 -.Os +.Os FreeBSD .Sh NAME .Nm kldunload .Nd unload a file from the kernel @@ -43,7 +43,7 @@ utility unloads a file which was previously loaded with .Xr kldload 8 . .Pp The options are: -.Bl -tag -width indent +.Bl -tag -width XXXXXXX -offset indent .It Fl v Be more verbose. .It Fl i Ar id @@ -54,7 +54,11 @@ Unload the file with this name. .Sh SEE ALSO .Xr kldload 8 , .Xr kldstat 8 +.Sh HISTORY +The +.Nm +command first appeared in +.Fx 3.0 . .Sh AUTHOR -.Bl -tag -Doug Rabson, dfr@freebsd.org -.El. +Doug Rabson +.Aq dfr@freebsd.org diff --git a/sbin/kldunload/kldunload.c b/sbin/kldunload/kldunload.c index fec453e..1badfed 100644 --- a/sbin/kldunload/kldunload.c +++ b/sbin/kldunload/kldunload.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: kldunload.c,v 1.1 1997/05/07 18:19:54 dfr Exp $ + * $Id: kldunload.c,v 1.2 1997/10/19 11:15:45 jmg Exp $ */ #include <err.h> @@ -33,36 +33,32 @@ #include <sys/param.h> #include <sys/linker.h> -extern char *optarg; -extern int optind; - -static char* progname; - -static void usage() +static void +usage(void) { fprintf(stderr, "usage: modunload [-i id] [-n filename]\n"); exit(1); } -int main(int argc, char** argv) +int +main(int argc, char** argv) { int c; int verbose = 0; int fileid = 0; char* filename = 0; - progname = argv[0]; - while ((c = getopt(argc, argv, "vi:n:")) != -1) + while ((c = getopt(argc, argv, "i:n:v")) != -1) switch (c) { - case 'v': - verbose = 1; - break; case 'i': fileid = atoi(optarg); break; case 'n': filename = optarg; break; + case 'v': + verbose = 1; + break; default: usage(); } @@ -76,8 +72,7 @@ int main(int argc, char** argv) usage(); if (filename) { - fileid = kldfind(filename); - if (fileid < 0) + if ((fileid = kldfind(filename)) < 0) err(1, "Can't find file %s", filename); } |