pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/wm/icewm Apply patches from Iain Hibbert to make work ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/92a38ed86e50
branches:  trunk
changeset: 476914:92a38ed86e50
user:      xtraeme <xtraeme%pkgsrc.org@localhost>
date:      Tue Jun 22 20:45:45 2004 +0000

description:
Apply patches from Iain Hibbert to make work the NetStatus app via
PR pkg/26001.

To use it, just add the following lines into your ~/.icewm/preferences:
(change ppp0 for your interface)

TaskBarShowNetStatus = 1
NetworkStatusDevice = "ppp0"

diffstat:

 wm/icewm/distinfo         |   4 ++-
 wm/icewm/patches/patch-ae |  24 +++++++++++++++++
 wm/icewm/patches/patch-af |  65 +++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 92 insertions(+), 1 deletions(-)

diffs (110 lines):

diff -r db2605edf9a0 -r 92a38ed86e50 wm/icewm/distinfo
--- a/wm/icewm/distinfo Tue Jun 22 20:43:56 2004 +0000
+++ b/wm/icewm/distinfo Tue Jun 22 20:45:45 2004 +0000
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.16 2004/04/09 10:41:06 wiz Exp $
+$NetBSD: distinfo,v 1.17 2004/06/22 20:45:45 xtraeme Exp $
 
 SHA1 (icewm-1.2.13.tar.gz) = ebfe807cbe3a9d931386833033eb9cb1792ea485
 Size (icewm-1.2.13.tar.gz) = 839636 bytes
 SHA1 (patch-ab) = 791868a4320a62ac81de487667f90cbdaeacd2a7
 SHA1 (patch-ad) = 4b4feeb255a035a77195bf6e6fe5ffda6d428754
+SHA1 (patch-ae) = b1db6d35fb2454c132c734b67483d8a9d22ed9df
+SHA1 (patch-af) = 8b074ce39a46873a09978e18904b252dfec0eecf
diff -r db2605edf9a0 -r 92a38ed86e50 wm/icewm/patches/patch-ae
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/wm/icewm/patches/patch-ae Tue Jun 22 20:45:45 2004 +0000
@@ -0,0 +1,24 @@
+$NetBSD: patch-ae,v 1.7 2004/06/22 20:45:45 xtraeme Exp $
+
+Turn on HAVE_NET_STATUS for NetBSD
+ 
+--- src/apppstatus.h.orig      Sat Sep 27 08:54:45 2003
++++ src/apppstatus.h   Sun Jun 20 18:19:04 2004
+@@ -9,7 +9,7 @@
+ #define NETSTATUS_H
+ 
+ #ifdef CONFIG_APPLET_NET_STATUS
+-#if defined(linux) || defined(__FreeBSD__)
++#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
+ 
+ #define HAVE_NET_STATUS 1
+ 
+@@ -61,7 +61,7 @@
+ };
+ 
+ 
+-#else // linux || __FreeBSD__
++#else // linux || __FreeBSD__ || __NetBSD__
+ #undef CONFIG_APPLET_NET_STATUS
+ #endif
+ #endif // CONFIG_APPLET_NET_STATUS
diff -r db2605edf9a0 -r 92a38ed86e50 wm/icewm/patches/patch-af
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/wm/icewm/patches/patch-af Tue Jun 22 20:45:45 2004 +0000
@@ -0,0 +1,65 @@
+$NetBSD: patch-af,v 1.8 2004/06/22 20:45:45 xtraeme Exp $
+
+Add some code for NetBSD to
+   a) check if an interface is up, and
+   b) get the in/out character count for that interface
+
+--- src/apppstatus.cc.orig     Sat Sep 27 08:54:45 2003
++++ src/apppstatus.cc  Sun Jun 20 20:45:26 2004
+@@ -363,6 +363,26 @@
+         return isUpIsdn();
+ #endif
+ 
++#ifdef __NetBSD__
++    struct ifreq ifr;
++
++    if (fNetDev == 0)
++        return false;
++
++    int s = socket(AF_INET, SOCK_DGRAM, 0);
++
++    if( s != -1 ) {
++      strncpy(ifr.ifr_name, fNetDev, sizeof(ifr.ifr_name));
++      if( ioctl(s, SIOCGIFFLAGS, (caddr_t)&ifr) != -1 ) {
++          if( ifr.ifr_flags & IFF_UP ) {
++              close(s);
++              return true;
++          }
++      }
++      close(s);
++    }
++    return false;
++#else
+     char buffer[32 * sizeof(struct ifreq)];
+     struct ifconf ifc;
+     struct ifreq *ifr;
+@@ -395,6 +415,7 @@
+ 
+     close(s);
+     return false;
++#endif // __NetBSD__
+ #endif // if 0
+ }
+ 
+@@ -522,6 +543,21 @@
+         }
+     }
+ #endif //FreeBSD
++#ifdef __NetBSD__
++    struct ifdatareq ifdr;
++    struct if_data * const ifi = &ifdr.ifdr_data;
++    int s;
++    
++    s = socket(AF_INET, SOCK_DGRAM, 0);
++    if( s != -1 ) {
++      strncpy(ifdr.ifdr_name, fNetDev, sizeof(ifdr.ifdr_name));
++      if (ioctl(s, SIOCGIFDATA, &ifdr) != -1) {
++          cur_ibytes = ifi->ifi_ibytes;
++          cur_obytes = ifi->ifi_obytes;
++      }
++      close(s);
++    }
++#endif //__NetBSD__
+ 
+     // correct the values and look for overflows
+     //msg("w/o corrections: ibytes: %lld, prev_ibytes; %lld, offset: %lld", cur_ibytes, prev_ibytes, offset_ibytes);



Home | Main Index | Thread Index | Old Index