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.
This commit is contained in:
Lars Fredriksen 1994-11-12 19:33:41 +00:00
parent 665583d21a
commit ab0f6b123c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4401

View file

@ -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)) {