diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2001-01-30 04:27:59 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2001-01-30 04:27:59 +0000 |
commit | 179da94f00485297271ab125a979af18d674333a (patch) | |
tree | a78d5b596205a14059ec7419a6041b5eefe3f267 /sbin/ipfstat/kmem.c | |
parent | 1a1e454b4bba88f2fa856f317639c83249c18974 (diff) |
reimplement whacked ipfstat changes
Diffstat (limited to 'sbin/ipfstat/kmem.c')
-rw-r--r-- | sbin/ipfstat/kmem.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sbin/ipfstat/kmem.c b/sbin/ipfstat/kmem.c index 7674d78999d..543da82be64 100644 --- a/sbin/ipfstat/kmem.c +++ b/sbin/ipfstat/kmem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kmem.c,v 1.16 2001/01/17 05:01:00 fgsch Exp $ */ +/* $OpenBSD: kmem.c,v 1.17 2001/01/30 04:27:58 kjell Exp $ */ /* * Copyright (C) 1993-2000 by Darren Reed. @@ -27,9 +27,13 @@ static const char rcsid[] = "@(#)$IPFilter: kmem.c,v 2.2 2000/03/13 22:10:25 dar static int kmemfd = -1; -int openkmem() +int openkmem(nlistf, memf) +char *nlistf, *memf; { - if ((kmemfd = open(KMEM,O_RDONLY)) == -1) + if (memf == NULL) + memf = KMEM; + + if ((kmemfd = open(memf,O_RDONLY)) == -1) { perror("kmeminit:open"); return -1; @@ -47,7 +51,7 @@ register int n; if (!n) return 0; if (kmemfd == -1) - if (openkmem() == -1) + if (openkmem(nlistf, memf) == -1) return -1; if (lseek(kmemfd, pos, 0) == -1) { @@ -78,7 +82,7 @@ register int n; if (!n) return 0; if (kmemfd == -1) - if (openkmem() == -1) + if (openkmem(nlistf, memf) == -1) return -1; if (lseek(kmemfd, pos, 0) == -1) { |