diff options
author | lars <lars@FreeBSD.org> | 1994-11-12 19:33:41 +0000 |
---|---|---|
committer | lars <lars@FreeBSD.org> | 1994-11-12 19:33:41 +0000 |
commit | 71c125fd6964c699b5688169f742202dc4e80983 (patch) | |
tree | 732421e580481fa8c50dacbed46d1003d66fc873 /usr.sbin/pppstats | |
parent | 01ba00a426adf03a8ae1a752fffecde60eb8d7d3 (diff) | |
download | FreeBSD-src-71c125fd6964c699b5688169f742202dc4e80983.zip FreeBSD-src-71c125fd6964c699b5688169f742202dc4e80983.tar.gz |
Obtained from: ppp-2.1.2
More correct use of __FreeBSD__ and BSD4_4 ifdefs. Fixed kvm_openfile()
call based upon suggestion from Bruce Evans.
Diffstat (limited to 'usr.sbin/pppstats')
-rw-r--r-- | usr.sbin/pppstats/pppstats.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr.sbin/pppstats/pppstats.c b/usr.sbin/pppstats/pppstats.c index cabaced..018277a 100644 --- a/usr.sbin/pppstats/pppstats.c +++ b/usr.sbin/pppstats/pppstats.c @@ -26,7 +26,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: pppstats.c,v 1.4 1994/06/08 00:38:49 paulus Exp $"; +static char rcsid[] = "$Id: pppstats.c,v 1.1.1.1 1994/11/12 06:07:15 lars Exp $"; #endif #include <ctype.h> @@ -79,7 +79,7 @@ extern off_t lseek(); char *kmemf; -#if defined(sun) || defined(__FreeBSD__) +#if defined(sun) || defined(BSD4_4) #include <kvm.h> kvm_t *kd; #define KDARG kd, @@ -196,12 +196,18 @@ main(argc, argv) perror("kvm_open"); exit(1); } -#else - /* BSD4.3+ */ +#elif defined(BSD4_4) + /* BSD4.4+ */ if ((kd = kvm_openfiles(system, kmemf, NULL, O_RDONLY, errbuf)) == NULL) { fprintf(stderr, "kvm_openfiles: %s", errbuf); exit(1); } +#else + /* BSD4.3+ */ + if (kvm_openfiles(system, kmemf, (char *)0) == -1) { + fprintf(stderr, "kvm_openfiles: %s", kvm_geterr()); + exit(1); + } #endif if (kvm_nlist(KDARG nl)) { |