summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/modload/modload.c9
-rw-r--r--sbin/modunload/modunload.83
-rw-r--r--sbin/modunload/modunload.c6
-rw-r--r--usr.bin/modstat/modstat.c18
4 files changed, 21 insertions, 15 deletions
diff --git a/sbin/modload/modload.c b/sbin/modload/modload.c
index cb9a120b97b..be45711e3aa 100644
--- a/sbin/modload/modload.c
+++ b/sbin/modload/modload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modload.c,v 1.36 2002/12/11 18:28:22 deraadt Exp $ */
+/* $OpenBSD: modload.c,v 1.37 2003/01/18 23:30:20 deraadt Exp $ */
/* $NetBSD: modload.c,v 1.30 2001/11/08 15:33:15 christos Exp $ */
/*
@@ -40,6 +40,7 @@
#include <sys/lkm.h>
#include <sys/stat.h>
#include <sys/file.h>
+
#include <err.h>
#include <errno.h>
#include <stdio.h>
@@ -47,13 +48,13 @@
#include <string.h>
#include <unistd.h>
#include <nlist.h>
+
+#include "modload.h"
#include "pathnames.h"
#define TRUE 1
#define FALSE 0
-#include "modload.h"
-
#ifndef DFLT_ENTRY
#define DFLT_ENTRY "xxxinit"
#endif /* !DFLT_ENTRY */
@@ -293,7 +294,7 @@ main(int argc, char *argv[])
* kernel).
*/
if ((devfd = open(_PATH_LKM, O_RDWR, 0)) == -1)
- err(3, _PATH_LKM);
+ err(3, "%s", _PATH_LKM);
fileopen |= DEV_OPEN;
strncpy(modout, modobj, sizeof(modout) - 1);
diff --git a/sbin/modunload/modunload.8 b/sbin/modunload/modunload.8
index 5f147c9ed61..eb02fabe132 100644
--- a/sbin/modunload/modunload.8
+++ b/sbin/modunload/modunload.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: modunload.8,v 1.10 2002/01/09 22:22:56 ericj Exp $
+.\" $OpenBSD: modunload.8,v 1.11 2003/01/18 23:30:20 deraadt Exp $
.\" $NetBSD: modunload.8,v 1.3 1995/03/18 14:56:49 cgd Exp $
.\"
.\" Copyright (c) 1993 Christopher G. Demetriou
@@ -36,6 +36,7 @@
.Nm modunload
.Op Fl i Ar id
.Op Fl n Ar name
+.Op Fl p Ar postunload
.Sh DESCRIPTION
The
.Nm
diff --git a/sbin/modunload/modunload.c b/sbin/modunload/modunload.c
index 32d533114dc..d7d167987d4 100644
--- a/sbin/modunload/modunload.c
+++ b/sbin/modunload/modunload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modunload.c,v 1.11 2002/12/11 16:58:39 deraadt Exp $ */
+/* $OpenBSD: modunload.c,v 1.12 2003/01/18 23:30:20 deraadt Exp $ */
/* $NetBSD: modunload.c,v 1.9 1995/05/28 05:23:05 jtc Exp $ */
/*
@@ -38,6 +38,7 @@
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/lkm.h>
+
#include <a.out.h>
#include <err.h>
#include <errno.h>
@@ -46,6 +47,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+
#include "pathnames.h"
static int devfd;
@@ -105,7 +107,7 @@ main(int argc, char *argv[])
* to ioctl() to retrive the loaded module(s) status).
*/
if ((devfd = open(_PATH_LKM, O_RDWR, 0)) == -1)
- err(2, _PATH_LKM);
+ err(2, "%s", _PATH_LKM);
atexit(cleanup);
diff --git a/usr.bin/modstat/modstat.c b/usr.bin/modstat/modstat.c
index 821f2b864de..c42ac481071 100644
--- a/usr.bin/modstat/modstat.c
+++ b/usr.bin/modstat/modstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: modstat.c,v 1.19 2002/12/12 00:00:16 deraadt Exp $ */
+/* $OpenBSD: modstat.c,v 1.20 2003/01/18 23:30:20 deraadt Exp $ */
/*
* Copyright (c) 1993 Terrence R. Lambert.
@@ -38,14 +38,16 @@
#include <sys/conf.h>
#include <sys/mount.h>
#include <sys/lkm.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
+
+#include <a.out.h>
#include <err.h>
+#include <errno.h>
#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <a.out.h>
-#include <errno.h>
+#include <unistd.h>
+
#include "pathnames.h"
#define POINTERSIZE ((int)(2 * sizeof(void*)))
@@ -59,7 +61,7 @@ static char *type_names[] = {
};
static void
-usage()
+usage(void)
{
extern char *__progname;
@@ -141,7 +143,7 @@ main(argc, argv)
* to ioctl() to retrive the loaded module(s) status).
*/
if ((devfd = open(_PATH_LKM, O_RDONLY)) == -1)
- err(2, _PATH_LKM);
+ err(2, "%s", _PATH_LKM);
setegid(getgid());
setgid(getgid());