From ac2452f504e0ececa1fa0c47ec36a3e5e9417e1c Mon Sep 17 00:00:00 2001 From: reinelt <> Date: Fri, 2 Mar 2001 20:18:12 +0000 Subject: [lcd4linux @ 2001-03-02 20:18:12 by reinelt] allow compile on systems without net/if_ppp.h --- system.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'system.c') diff --git a/system.c b/system.c index ad24e54..c0d0aa6 100644 --- a/system.c +++ b/system.c @@ -1,4 +1,4 @@ -/* $Id: system.c,v 1.19 2001/02/16 08:23:09 reinelt Exp $ +/* $Id: system.c,v 1.20 2001/03/02 20:18:12 reinelt Exp $ * * system status retreivement * @@ -20,6 +20,10 @@ * * * $Log: system.c,v $ + * Revision 1.20 2001/03/02 20:18:12 reinelt + * + * allow compile on systems without net/if_ppp.h + * * Revision 1.19 2001/02/16 08:23:09 reinelt * * new token 'ic' (ISDN connected) by Carsten Nau @@ -177,7 +181,12 @@ #include #include #include + +#ifdef HAVE_NET_IF_PPP_H #include +#else +#warning if_ppp.h not found. PPP support deactivated. +#endif #include "debug.h" #include "cfg.h" @@ -667,14 +676,17 @@ int Net (int *rx, int *tx, int *bytes) int PPP (int unit, int *rx, int *tx) { static int fd=-2; - struct ifpppstatsreq req; char buffer[16]; - - static double junk=0; + +#ifdef HAVE_NET_IF_PPP_H + struct ifpppstatsreq req; +#endif *rx=0; *tx=0; +#ifdef HAVE_NET_IF_PPP_H + if (fd==-1) return -1; if (fd==-2) { @@ -697,8 +709,8 @@ int PPP (int unit, int *rx, int *tx) *rx=smooth(buffer, 500, req.stats.p.ppp_ibytes); snprintf (buffer, sizeof(buffer), "ppp%d_tx", unit); *tx=smooth(buffer, 500, req.stats.p.ppp_obytes); - debug ("ppp_tx=%f smooth=%f", (double)(req.stats.p.ppp_obytes-junk), (double)*tx); - junk=req.stats.p.ppp_obytes; + +#endif return 0; } -- cgit v1.2.3