1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-20 02:38:43 +00:00

a few code style changes:

o start function names in column 1
    o sort order of flags in getopt and switch
    o don't try to reference progname
    o unspam some changes introduced by a 2.2.1-R build box instead of a
	-current build box

doc changes:
    o document when these commands first appeared
    o put email address in angle brakets
    o minor mdoc clean up
This commit is contained in:
John-Mark Gurney 1997-10-21 09:59:26 +00:00
parent 9cf7c6b0e5
commit 2830148a29
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=30627
6 changed files with 57 additions and 54 deletions

View File

@ -23,11 +23,11 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\" $Id: kldload.8,v 1.1 1997/05/07 18:19:21 dfr Exp $
.\"
.Dd April 25, 1997
.Dt KLDLOAD 8
.Os
.Os FreeBSD
.Sh NAME
.Nm kldload
.Nd load a file into the kernel
@ -41,14 +41,20 @@ The
loads a file into the kernel using the kernel linker.
.Pp
The options are:
.Bl -tag -width indent
.Bl -tag -width XXX -offset indent
.It Fl v
Be more verbose.
.El
.Sh SEE ALSO
.Xr kldstat 8 ,
.Xr kldunload 8
.Sh HISTORY
The
.Nm
command first appeared in
.Fx 3.0 .
.Sh AUTHOR
.Bl -tag
Doug Rabson, dfr@freebsd.org
Doug Rabson
.Aq dfr@freebsd.org
.El.

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: kldload.c,v 1.1 1997/05/07 18:19:21 dfr Exp $
* $Id: kldload.c,v 1.2 1997/10/19 11:15:42 jmg Exp $
*/
#include <err.h>
@ -33,23 +33,20 @@
#include <sys/param.h>
#include <sys/linker.h>
extern int optind;
static char* progname;
static void usage()
static void
usage(void)
{
fprintf(stderr, "usage: %s filename\n", progname);
fprintf(stderr, "usage: kldload filename\n");
exit(1);
}
int main(int argc, char** argv)
int
main(int argc, char** argv)
{
int c;
int verbose = 0;
int fileid;
progname = argv[0];
while ((c = getopt(argc, argv, "v")) != -1)
switch (c) {
case 'v':

View File

@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" $Id$
.\" $Id: kldstat.8,v 1.1 1997/05/07 18:19:54 dfr Exp $
.\"
.Dd April 25, 1997
.Dt KLDSTAT 8
@ -43,7 +43,7 @@ utility displays the status of any files dynamically linked into the
kernel.
.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,13 @@ Display the status of only the file with this name.
.Sh SEE ALSO
.Xr kldload 8 ,
.Xr kldunload 8
.Sh HISTORY
The
.Nm
command first appeared in
.Fx 3.0 .
.Sh AUTHOR
.Bl -tag
Doug Rabson, dfr@freebsd.org
Doug Rabson
.Aq dfr@freebsd.org
.El.

View File

@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: kldstat.c,v 1.1 1997/05/07 18:19:54 dfr Exp $
* $Id: kldstat.c,v 1.2 1997/10/19 11:15:44 jmg Exp $
*/
#include <err.h>
@ -35,12 +35,8 @@
#include <sys/module.h>
#include <sys/linker.h>
extern char *optarg;
extern int optind;
static char* progname;
static void printmod(int modid)
static void
printmod(int modid)
{
struct module_stat stat;
@ -73,31 +69,31 @@ static void printfile(int fileid, int verbose)
}
static void
usage()
usage(void)
{
fprintf(stderr, "usage: %s [-v]\n", progname);
fprintf(stderr, "usage: kldstat [-v]\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();
}
@ -108,8 +104,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);
}

View File

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

View File

@ -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);
}