aboutsummaryrefslogtreecommitdiff
path: root/deskutils/superkaramba
diff options
context:
space:
mode:
authorJames E. Housley <jeh@FreeBSD.org>2003-11-09 19:27:19 +0000
committerJames E. Housley <jeh@FreeBSD.org>2003-11-09 19:27:19 +0000
commit391bfd0160acdff7847a60c6ae46a6b178e2e137 (patch)
tree79cc080518a97b7da8b574e12bbbf0f62db5d6b1 /deskutils/superkaramba
parent2d9fc12a5ccbee8f0bd1bfc6f6efa459a98a38cb (diff)
downloadports-391bfd0160acdff7847a60c6ae46a6b178e2e137.tar.gz
ports-391bfd0160acdff7847a60c6ae46a6b178e2e137.zip
Notes
Diffstat (limited to 'deskutils/superkaramba')
-rw-r--r--deskutils/superkaramba/Makefile1
-rw-r--r--deskutils/superkaramba/files/patch-networksensor.cpp34
2 files changed, 17 insertions, 18 deletions
diff --git a/deskutils/superkaramba/Makefile b/deskutils/superkaramba/Makefile
index a75cd08ed4e0..e00fe7486a9e 100644
--- a/deskutils/superkaramba/Makefile
+++ b/deskutils/superkaramba/Makefile
@@ -6,6 +6,7 @@
PORTNAME= superkaramba
PORTVERSION= 0.33
+PORTREVISION= 1
CATEGORIES= deskutils kde
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= netdragon
diff --git a/deskutils/superkaramba/files/patch-networksensor.cpp b/deskutils/superkaramba/files/patch-networksensor.cpp
index 413d1f98d207..eb1df1936b87 100644
--- a/deskutils/superkaramba/files/patch-networksensor.cpp
+++ b/deskutils/superkaramba/files/patch-networksensor.cpp
@@ -1,6 +1,6 @@
--- src/networksensor.cpp.orig Mon Apr 21 15:17:03 2003
-+++ src/networksensor.cpp Sat Nov 8 19:51:04 2003
-@@ -7,14 +7,67 @@
++++ src/networksensor.cpp Sun Nov 9 18:34:35 2003
+@@ -7,14 +7,65 @@
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
@@ -11,7 +11,6 @@
+#include <net/route.h>
+#endif
+
-+#include <stdio.h>
#include "networksensor.h"
NetworkSensor::NetworkSensor( QString dev, int interval ):Sensor( interval )
@@ -40,27 +39,26 @@
+ */
+
+ if_number = -1;
++ int if_gw = -1;
+
+ for (int i = 1; i <= n; ++i) {
+ name[4] = i;
+ /* Get data for iface-number i */
+ sysctl(name, 6, (void*)&if_mib, (size_t*)&if_miblen, (void*)NULL, (size_t)0);
+
-+ if ( device == "" ) {
-+ /* Does the interface hold the default route? */
-+ if ( if_mib.ifmd_flags & RTF_GATEWAY ) {
-+ if_number = i;
-+ break;
-+ }
-+ }
-+ else {
-+ /* We found the right interface? */
-+ if (QString(if_mib.ifmd_name) == device) {
-+ if_number = i;
-+ break;
-+ }
++ /* We found the right interface? */
++ if (QString(if_mib.ifmd_name) == device) {
++ if_number = i;
++ break;
+ }
++
++ /* Does the interface hold the default route? */
++ if ( if_mib.ifmd_flags & RTF_GATEWAY )
++ if_gw = i;
+ }
++
++ if ((if_number == -1) && (if_gw != -1))
++ if_number = if_gw;
+#else
if( device == "" )
device = "eth0";
@@ -69,7 +67,7 @@
getInOutBytes(receivedBytes,transmittedBytes);
netTimer.start();
-@@ -24,6 +77,27 @@
+@@ -24,6 +75,27 @@
}
void NetworkSensor::getInOutBytes ( unsigned long &in,unsigned long &out) const
{
@@ -97,7 +95,7 @@
QFile file("/proc/net/dev");
QString line;
if ( file.open(IO_ReadOnly | IO_Translate) )
-@@ -49,6 +123,7 @@
+@@ -49,6 +121,7 @@
}
file.close();
}