[package] use debian's patch to some display issues (#5182)
authorFlorian Fainelli <florian@openwrt.org>
Tue, 26 May 2009 14:21:59 +0000 (14:21 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 26 May 2009 14:21:59 +0000 (14:21 +0000)
SVN-Revision: 16080

net/bwm/Makefile
net/bwm/patches/001-debian.patch [new file with mode: 0644]

index be86629..17d2c30 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=bwm
 PKG_VERSION:=1.1.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)_$(PKG_VERSION).orig.tar.gz
 PKG_SOURCE_URL:=http://ftp.debian.org/debian/pool/main/b/bwm
diff --git a/net/bwm/patches/001-debian.patch b/net/bwm/patches/001-debian.patch
new file mode 100644 (file)
index 0000000..043d862
--- /dev/null
@@ -0,0 +1,45 @@
+--- a/bwm.c
++++ b/bwm.c
+@@ -57,7 +57,8 @@ int main(int argc, char *argv[])
+   char buffer[256];
+   char *buffer_pointer;
+-  int inum;
++  int inum = -1;
++  int oldinum = -1;
+   int field_number;
+   int total_counter;
+   int sleep_time = 2;
+@@ -90,7 +91,13 @@ int main(int argc, char *argv[])
+   while(1)
+   {
+-    printf("%c[H",27);
++    if (inum==oldinum)
++    {
++      printf("%c[H",27);
++    } else {
++      printf("%c[H%c[J",27,27);
++      oldinum = inum;
++    }
+     printf("Bandwidth Monitor 1.1.0\n\n");
+     printf("       Iface        RX(KB/sec)   TX(KB/sec)   Total(KB/sec)\n\n");
+@@ -138,7 +145,7 @@ int main(int argc, char *argv[])
+               interface[inum].rx_kbytes_dif =
+                (interface[inum].rx_bytes_new -
+-                interface[inum].rx_bytes_old) * 1000 / 1024;
++                interface[inum].rx_bytes_old) / 1024 * 1000;
+               interface[inum].rx_rate_whole = 
+                interface[inum].rx_kbytes_dif / 
+@@ -157,7 +164,7 @@ int main(int argc, char *argv[])
+               interface[inum].tx_kbytes_dif =
+                (interface[inum].tx_bytes_new -
+-                interface[inum].tx_bytes_old) * 1000 / 1024;
++                interface[inum].tx_bytes_old) / 1024 * 1000;
+               interface[inum].tx_rate_whole = 
+                interface[inum].tx_kbytes_dif /