diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-06-21 11:40:10 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1996-06-21 11:40:10 +0000 |
commit | dd8213bee95d29c39197672abd0dcae47e562a6c (patch) | |
tree | e842178c458e7630ae107cce78e64127b5e691db | |
parent | 3a46a3f7d677b29f356ba2a90bbd15a37ad0f2b8 (diff) |
updates according to the kernel chenges.
-rw-r--r-- | sbin/modunload/modunload.c | 7 | ||||
-rw-r--r-- | usr.bin/modstat/modstat.c | 10 |
2 files changed, 10 insertions, 7 deletions
diff --git a/sbin/modunload/modunload.c b/sbin/modunload/modunload.c index 087dec8f2f7..d56646b474d 100644 --- a/sbin/modunload/modunload.c +++ b/sbin/modunload/modunload.c @@ -1,3 +1,4 @@ +/* $OpenBSD: modunload.c,v 1.2 1996/06/21 11:39:17 mickey Exp $ */ /* $NetBSD: modunload.c,v 1.9 1995/05/28 05:23:05 jtc Exp $ */ /* @@ -72,7 +73,7 @@ main(argc, argv) { int c; int modnum = -1; - char *modname = NULL; + char modname[MAXLKMNAME] = ""; struct lmc_unload ulbuf; while ((c = getopt(argc, argv, "i:n:")) != EOF) { @@ -81,7 +82,7 @@ main(argc, argv) modnum = atoi(optarg); break; /* number */ case 'n': - modname = optarg; + strcpy(modname, optarg); break; /* name */ case '?': usage(); @@ -93,7 +94,7 @@ main(argc, argv) argc -= optind; argv += optind; - if (argc != 0 || (modnum == -1 && modname == NULL)) + if (argc != 0 || (modnum == -1 && *modname == '\0')) usage(); diff --git a/usr.bin/modstat/modstat.c b/usr.bin/modstat/modstat.c index 02ca89b8354..a5044db7cf5 100644 --- a/usr.bin/modstat/modstat.c +++ b/usr.bin/modstat/modstat.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: modstat.c,v 1.1 1995/10/18 08:45:48 deraadt Exp $ + * $Id: modstat.c,v 1.2 1996/06/21 11:40:09 mickey Exp $ */ #include <stdio.h> @@ -71,12 +71,14 @@ dostat(devfd, modnum, modname) char *modname; { struct lmc_stat sbuf; + char name[MAXLKMNAME] = ""; + + sbuf.id = modnum; + sbuf.name = name; if (modname != NULL) strcpy(sbuf.name, modname); - sbuf.id = modnum; - if (ioctl(devfd, LMSTAT, &sbuf) == -1) { switch (errno) { case EINVAL: /* out of range */ @@ -92,7 +94,7 @@ dostat(devfd, modnum, modname) /* * Decode this stat buffer... */ - printf("%-7s %3d %3d %08x %04x %8x %3d %s\n", + printf("%-7s %3d %3d %08x %04x %8x %3d s\n", type_names[sbuf.type], sbuf.id, /* module id */ sbuf.offset, /* offset into modtype struct */ |