Module Name: src
Committed By: mbalmer
Date: Tue Aug 2 16:46:45 UTC 2011
Modified Files:
src/sbin/modstat: main.c modstat.8
Log Message:
Accept both 'modstat -n name' as well as 'modstat name' to display information
about a single module.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sbin/modstat/main.c
cvs rdiff -u -r1.8 -r1.9 src/sbin/modstat/modstat.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/modstat/main.c
diff -u src/sbin/modstat/main.c:1.13 src/sbin/modstat/main.c:1.14
--- src/sbin/modstat/main.c:1.13 Fri Jun 3 16:35:35 2011
+++ src/sbin/modstat/main.c Tue Aug 2 16:46:45 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.13 2011/06/03 16:35:35 pgoyette Exp $ */
+/* $NetBSD: main.c,v 1.14 2011/08/02 16:46:45 mbalmer Exp $ */
/*-
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.13 2011/06/03 16:35:35 pgoyette Exp $");
+__RCSID("$NetBSD: main.c,v 1.14 2011/08/02 16:46:45 mbalmer Exp $");
#endif /* !lint */
#include <sys/module.h>
@@ -88,7 +88,9 @@
argc -= optind;
argv += optind;
- if (argc != 0)
+ if (argc == 1 && name == NULL)
+ name = argv[0];
+ else if (argc != 0)
usage();
if (prog_init && prog_init() == -1)
@@ -155,7 +157,7 @@
usage(void)
{
- (void)fprintf(stderr, "Usage: %s [-n name]\n", getprogname());
+ (void)fprintf(stderr, "Usage: %s [-n] [name]\n", getprogname());
exit(EXIT_FAILURE);
}
Index: src/sbin/modstat/modstat.8
diff -u src/sbin/modstat/modstat.8:1.8 src/sbin/modstat/modstat.8:1.9
--- src/sbin/modstat/modstat.8:1.8 Tue Dec 14 16:23:59 2010
+++ src/sbin/modstat/modstat.8 Tue Aug 2 16:46:45 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: modstat.8,v 1.8 2010/12/14 16:23:59 jruoho Exp $
+.\" $NetBSD: modstat.8,v 1.9 2011/08/02 16:46:45 mbalmer 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 December 14, 2010
+.Dd August 2, 2011
.Dt MODSTAT 8
.Os
.Sh NAME
@@ -40,17 +40,20 @@
.Nd display status of loaded kernel modules
.Sh SYNOPSIS
.Nm
-.Op Fl n Ar name
+.Op Fl n
+.Op Ar name
.Sh DESCRIPTION
The
.Nm
-utility displays the status of any kernel modules
-present in the kernel.
+utility displays the status of any kernel modules present in the kernel.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl n Ar name
Display the status of only the module with this name.
+Please note that
+.Fl n
+is optional.
.El
.Pp
In addition to listing the currently loaded modules' name,