diff options
author | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2001-03-02 20:18:12 +0000 |
---|---|---|
committer | reinelt <reinelt@3ae390bd-cb1e-0410-b409-cd5a39f66f1f> | 2001-03-02 20:18:12 +0000 |
commit | 4f3c19b6c507608b273a9e27c678d2d28596ee62 (patch) | |
tree | d1f7190287527a6f5b14e872d7178abe4c576784 /system.c | |
parent | 78d14698bd109638777b43a836c0f55e839218e4 (diff) | |
download | lcd4linux-4f3c19b6c507608b273a9e27c678d2d28596ee62.tar.gz |
[lcd4linux @ 2001-03-02 20:18:12 by reinelt]
allow compile on systems without net/if_ppp.h
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@97 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'system.c')
-rw-r--r-- | system.c | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -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 <info@cnau.de> @@ -177,7 +181,12 @@ #include <sys/param.h> #include <sys/ioctl.h> #include <sys/socket.h> + +#ifdef HAVE_NET_IF_PPP_H #include <net/if_ppp.h> +#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; } |