From: Paul Mackerras Date: Wed, 28 Aug 1996 06:43:30 +0000 (+0000) Subject: mods for linux and osf X-Git-Tag: RELEASE_2_3_6~349 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=5a81a8837730149ecc71d0e61a38307575d48723 mods for linux and osf --- diff --git a/pppstats/pppstats.c b/pppstats/pppstats.c index 2149f25..aa74575 100644 --- a/pppstats/pppstats.c +++ b/pppstats/pppstats.c @@ -32,7 +32,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: pppstats.c,v 1.14 1996/07/01 05:32:57 paulus Exp $"; +static char rcsid[] = "$Id: pppstats.c,v 1.15 1996/08/28 06:43:30 paulus Exp $"; #endif #include @@ -397,6 +397,9 @@ main(argc, argv) char *argv[]; { int c; +#ifdef STREAMS + char *dev; +#endif interface = "ppp0"; if ((progname = strrchr(argv[0], '/')) == NULL) @@ -467,6 +470,11 @@ main(argc, argv) perror("couldn't create IP socket"); exit(1); } + +#ifdef _linux_ +#undef ifr_name +#define ifr_name ifr_ifrn.ifrn_name +#endif strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name)); if (ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) < 0) { fprintf(stderr, "%s: nonexistent interface '%s' specified\n", @@ -476,9 +484,14 @@ main(argc, argv) } #else /* STREAMS */ - if ((s = open("/dev/ppp", O_RDONLY)) < 0) { - fprintf(stderr, "%s: ", progname); - perror("couldn't open /dev/ppp"); +#ifdef __osf__ + dev = "/dev/streams/ppp"; +#else + dev = "/dev/ppp"; +#endif + if ((s = open(dev, O_RDONLY)) < 0) { + fprintf(stderr, "%s: couldn't open ", progname); + perror(dev); exit(1); } if (strioctl(s, PPPIO_ATTACH, &unit, sizeof(int), 0) < 0) {