From 23e200d5ab0c8860ef95938f1d2eb92dac4590ef Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Sun, 19 Oct 1997 11:15:45 +0000 Subject: [PATCH] activate the programs that will be used to manipulate kld modules fix a few problems with missing headers, warn called with an exit value, and undeclared getopt vars these programs now compile -Wall clean (and yes, I know I should use more than just -Wall) :) --- sbin/Makefile | 3 ++- sbin/kldload/Makefile | 4 +++- sbin/kldload/kldload.c | 6 +++++- sbin/kldstat/Makefile | 4 +++- sbin/kldstat/kldstat.c | 13 +++++++++---- sbin/kldunload/Makefile | 4 +++- sbin/kldunload/kldunload.c | 7 ++++++- 7 files changed, 31 insertions(+), 10 deletions(-) diff --git a/sbin/Makefile b/sbin/Makefile index e05d0d208e1..95f6286a6db 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -3,7 +3,8 @@ # XXX MISSING: icheck ncheck SUBDIR= adjkerntz badsect ccdconfig clri disklabel dmesg dset dump dumpfs \ - dumplfs dumpon fsck fsdb fsirand ifconfig init ipfw md5 mknod modload \ + dumplfs dumpon fsck fsdb fsirand ifconfig init ipfw \ + kldload kldstat kldunload md5 mknod modload \ modunload mount mount_cd9660 mount_ext2fs \ mount_lfs mount_nfs mount_null mount_portal mount_std \ mount_umap mount_union mountd newfs newlfs nfsd nfsiod \ diff --git a/sbin/kldload/Makefile b/sbin/kldload/Makefile index 39033e5a3f4..dda3fbcd33d 100644 --- a/sbin/kldload/Makefile +++ b/sbin/kldload/Makefile @@ -23,11 +23,13 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id$ +# $Id: Makefile,v 1.1 1997/05/07 18:19:21 dfr Exp $ # PROG= kldload SRCS= kldload.c MAN8= kldload.8 +CFLAGS= -I${.CURDIR}/../../sys + .include diff --git a/sbin/kldload/kldload.c b/sbin/kldload/kldload.c index e2a58be5a1f..3145fde8fc9 100644 --- a/sbin/kldload/kldload.c +++ b/sbin/kldload/kldload.c @@ -23,14 +23,18 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: kldload.c,v 1.1 1997/05/07 18:19:21 dfr Exp $ */ +#include #include +#include #include #include #include +extern int optind; + static char* progname; static void usage() diff --git a/sbin/kldstat/Makefile b/sbin/kldstat/Makefile index 27cdf271699..ff5d75ce690 100644 --- a/sbin/kldstat/Makefile +++ b/sbin/kldstat/Makefile @@ -23,11 +23,13 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id$ +# $Id: Makefile,v 1.1 1997/05/07 18:19:54 dfr Exp $ # PROG= kldstat SRCS= kldstat.c MAN8= kldstat.8 +CFLAGS= -I${.CURDIR}/../../sys + .include diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c index edb045fbe55..9b6b2dded4c 100644 --- a/sbin/kldstat/kldstat.c +++ b/sbin/kldstat/kldstat.c @@ -23,16 +23,21 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: kldstat.c,v 1.1 1997/05/07 18:19:54 dfr Exp $ */ +#include #include +#include #include #include #include #include #include +extern char *optarg; +extern int optind; + static char* progname; static void printmod(int modid) @@ -41,7 +46,7 @@ static void printmod(int modid) stat.version = sizeof(struct module_stat); if (modstat(modid, &stat) < 0) - warn(1, "Can't state module"); + warn("Can't stat module id %d", modid); else printf("\t\t%2d %s\n", stat.id, stat.name); } @@ -53,9 +58,9 @@ static void printfile(int fileid, int verbose) stat.version = sizeof(struct kld_file_stat); if (kldstat(fileid, &stat) < 0) - warn(1, "Can't stat file"); + warn("Can't stat file id %d", fileid); else - printf("%2d %4d %-8x %-8x %s\n", + printf("%2d %4d %p %-8x %s\n", stat.id, stat.refs, stat.address, stat.size, stat.name); if (verbose) { diff --git a/sbin/kldunload/Makefile b/sbin/kldunload/Makefile index 7f7fffb5c1b..faf372f0985 100644 --- a/sbin/kldunload/Makefile +++ b/sbin/kldunload/Makefile @@ -23,11 +23,13 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# $Id$ +# $Id: Makefile,v 1.1 1997/05/07 18:19:54 dfr Exp $ # PROG= kldunload SRCS= kldunload.c MAN8= kldunload.8 +CFLAGS= -I${.CURDIR}/../../sys + .include diff --git a/sbin/kldunload/kldunload.c b/sbin/kldunload/kldunload.c index 5f94ef98d07..fec453ee8e4 100644 --- a/sbin/kldunload/kldunload.c +++ b/sbin/kldunload/kldunload.c @@ -23,14 +23,19 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: kldunload.c,v 1.1 1997/05/07 18:19:54 dfr Exp $ */ +#include #include +#include #include #include #include +extern char *optarg; +extern int optind; + static char* progname; static void usage()