[Pkg-wmaker-commits] [wmifs] 04/04: Imported Debian patch 1.3b1-11

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 02:38:10 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to annotated tag debian/1.3b1-11
in repository wmifs.

commit 18fd7e310ecaa69b579c398c0bf526e09a7987ba
Author: Jordi Mallach <jordi at debian.org>
Date:   Tue Jan 15 20:56:47 2002 +0100

    Imported Debian patch 1.3b1-11
---
 debian/README.debian |  10 -----
 debian/changelog     | 102 +++++++++++++++++++++++++++++++++++++++++++---
 debian/conffiles     |   1 -
 debian/control       |  14 ++++---
 debian/copyright     |  11 +++--
 debian/dirs          |   2 +-
 debian/docs          |   5 ++-
 debian/manpages      |   1 +
 debian/menu          |   3 ++
 debian/rules         |  54 ++++++++++++++----------
 debian/wmifs.1       |  64 +++++++++++++++++++++++++++++
 wmifs/Makefile       |  38 ++++++++++-------
 wmifs/wmifs.c        | 113 ++++++++++++++++++++++++++++++++-------------------
 13 files changed, 315 insertions(+), 103 deletions(-)

diff --git a/debian/README.debian b/debian/README.debian
deleted file mode 100644
index c917825..0000000
--- a/debian/README.debian
+++ /dev/null
@@ -1,10 +0,0 @@
-wmifs for Debian
-----------------------
-
-wmifs is a dockable applet for X11 that can monitor all
-your network interfaces. It's designed for WindowMaker's dock, but
-it works with other windowmanagers of course.
-
-WMiFS stands for "Window Maker InterFace Statistics".
-
-Ben Gertzfield <che at debian.org>, Mon, 17 Aug 1998 12:54:47 -0700
diff --git a/debian/changelog b/debian/changelog
index 2bb069d..0c94b40 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,100 @@
+wmifs (1.3b1-11) unstable; urgency=low
+
+  * debian/changelog: removed emacs stuff.
+  * debian/conffiles: removed; DH_COMPAT=3 adds it for us.
+  * debian/copyright: added upstream authors.
+  * debian/rules: removed dh_make cruft.
+  * debian/wmifs.1: documented Lock Mode.
+  * wmifs/wmifs.c: the long interface name patch made wmifs segfault with
+    some interfaces. Matyas Koszik <koszik at debijan.lonyay.edu.hu> spotted
+    problem and mhp provided a nice patch with Matyas' fix (closes: #126501).
+    This may fix #119181 too, but I can't check too well.
+
+ -- Jordi Mallach <jordi at debian.org>  Tue, 15 Jan 2002 20:56:47 +0100
+
+wmifs (1.3b1-10) unstable; urgency=low
+
+  * wmifs/wmifs.c: patch from Davi Leal <davileal at terra.es> which fixes
+    the display of long interface names. wmifs only has space to display
+    interface names which are 5 characters long at the most. Now it will
+    cut interface names so they fit well. For example, "dummy0" will be
+    displayed as "dumm0", or "vmnet10" as "vmn10" (closes: #103083).
+
+ -- Jordi Mallach <jordi at debian.org>  Fri, 31 Aug 2001 02:51:59 +0200
+
+wmifs (1.3b1-9) unstable; urgency=low
+
+  * debian/control: Standards-Version: 3.5.6.0 (no changes).
+  * wmifs/wmifs.c: uncomment the ioctl call which makes ppp stats work.
+    Thanks, Patrick (closes: #105361).
+
+ -- Jordi Mallach <jordi at debian.org>  Thu,  2 Aug 2001 02:55:50 +0200
+
+wmifs (1.3b1-8) unstable; urgency=low
+
+  * wmifs/wmifs.c: fixed a thinko in the previous patch. If you use
+    LockMode without providing an interface, ignore the lock. Thanks
+    again, Jorge.
+
+ -- Jordi Mallach <jordi at debian.org>  Fri, 24 Jun 2001 23:24:29 +0200
+
+wmifs (1.3b1-7) unstable; urgency=low
+
+  * debian/control: Standards-Version: 3.5.5.0.
+  * debian/wmifs.1: added a missing newline.
+  * wmifs/wmifs.c: added a new command line argument, -l, which starts
+    wmifs in "Lock Mode". With it, if you specify an interface with -i
+    but it's not up, wmifs won't try to fall back to another existing
+    interface. Thanks to Jorge Garc�a for the help. (closes: #26870)
+  * And finally wmifs is bugfree(tm) (or you haven't reported them :)
+
+ -- Jordi Mallach <jordi at debian.org>  Sat, 16 Jun 2001 20:11:58 +0200
+
+wmifs (1.3b1-6) unstable; urgency=low
+
+  * New Maintainer.
+  * debian/control:
+    + Standards-Version: 3.5.4.0
+    + Build-Depends against xlibs-dev, debhelper (>= 3.0.0) (closes: #92681)
+    + minor modifications to the description
+  * debian/rules:
+    + added DEB_BUILD_OPTIONS support
+    + cleaned up a bit, added the install target
+    + DH_COMPAT=3
+    + install binary in /usr/bin
+    + install the new manpage
+  * debian/README.Debian: removed.
+  * debian/copyright:
+    + new download URL
+    + changed copyright location
+  * debian/menu: it's back! (closes: #77005, thanks xtifr)
+  * debian/wmifs.1: wrote a manpage for wmifs. It's not funny, but
+    someone else wrote it while I was working on the NMU. Thanks for
+    the effort anyway, Evelyn (closes: #93478).
+  * wmifs/Makefile:
+    + fixed things so DEB_BUILD_OPTIONS work
+    + fixed clean rule (closes: #27458)
+  * wmbifs/wmifs.c:
+    + applied patch from Barak Pearlmutter <bap at cs.unm.edu> which fixes a
+      bad 'catching up' behaviour after suspends (closes: #40682, #83003)
+    + applied patch from Chris Hanson <cph at martigny.ai.mit.edu>, fixes
+      a segfault when there are many network interfaces in the system
+      (closes: #39922)
+    + fixed WMIFS_VERSION
+  * These were fixed in previous uploads, closes: #41746, #67983).
+
+ -- Jordi Mallach <jordi at debian.org>  Sun,  6 May 2001 13:50:04 +0200
+
+wmifs (1.3b1-5.1) unstable; urgency=low
+
+  * NMU by Branden Robinson <branden at debian.org>.
+  * Recompile against modern xpm4g package to get proper shared library
+    dependency and permit this package to be installed with forthcoming
+    XFree86 4.x packages, which include libXpm.
+  * debian/control: added Build-Depends
+
+ -- Branden Robinson <branden at debian.org>  Mon, 23 Oct 2000 14:45:48 -0500
+
 wmifs (1.3b1-5) unstable; urgency=low
 
   * Remove annoying "heyho!" debugging printf that happened when one
@@ -30,8 +127,3 @@ wmifs (1.3b1-1) unstable; urgency=low
   * Initial Release.
 
  -- Ben Gertzfield <che at debian.org>  Tue, 25 Aug 1998 13:36:10 -0700
-
-Local variables:
-mode: debian-changelog
-add-log-mailing-address: "che at debian.org"
-End:
diff --git a/debian/conffiles b/debian/conffiles
deleted file mode 100644
index e6b7c0a..0000000
--- a/debian/conffiles
+++ /dev/null
@@ -1 +0,0 @@
-/etc/wmifsrc
diff --git a/debian/control b/debian/control
index b432a22..878b8fd 100644
--- a/debian/control
+++ b/debian/control
@@ -1,8 +1,9 @@
 Source: wmifs
 Section: x11
 Priority: optional
-Maintainer: Ben Gertzfield <che at debian.org>
-Standards-Version: 2.4.0.0
+Maintainer: Jordi Mallach <jordi at debian.org>
+Build-Depends: debhelper (>= 3.0.0), xlibs-dev
+Standards-Version: 3.5.6.0
 
 Package: wmifs
 Architecture: any
@@ -10,6 +11,9 @@ Depends: ${shlibs:Depends}
 Conflicts: wmppp.app (<= 1.1-1)
 Replaces: wmppp.app (<= 1.1-1)
 Description: WindowMaker dock app for monitoring network traffic
- wmifs is a dockable applet for X11 that can monitor all
- your network interfaces. It's designed for WindowMaker's dock, but
- it works with other windowmanagers of course.
+ wmifs is a dockable applet for X11 that can monitor all your network
+ interfaces. It's designed for WindowMaker's Dock and AfterStep's Wharf,
+ but it's not dependent on these window managers and should work with any
+ other.
+ .
+ WMiFS stands for "Window Maker InterFace Statistics".
diff --git a/debian/copyright b/debian/copyright
index 84bcaf2..e05cde1 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,10 +1,15 @@
-This package was debianized by Ben Gertzfield che at debian.org on
+This package was debianized by Ben Gertzfield <che at debian.org> on
 Tue, 25 Aug 1998 13:37:07 -0700
+Jordi Mallach <jordi at debian.org> took over the packaging on
+Sun,  6 May 2001 13:50:04 +0200
 
-It was downloaded from http://windowmaker.mezaway.org/wmifs.html
+It was downloaded from http://web.cs.mun.ca/~gstarkes/wmaker/dockapps/net.html
 
+Upstream Authors: Martijn Pieterse <pieterse at xs4all.nl>
+		  Antoine Nulle <warp at xs4all.nl>
+	    
 Copyright:
 
 WMiFS is released under the GNU General Public License, version 2 or
 greater, found on Debian GNU/Linux systems in the file
-/usr/doc/copyright/GPL
+`/usr/share/common-licenses/GPL'
diff --git a/debian/dirs b/debian/dirs
index bee0244..b745c0b 100644
--- a/debian/dirs
+++ b/debian/dirs
@@ -1,2 +1,2 @@
-usr/X11R6/bin
+usr/bin
 etc
diff --git a/debian/docs b/debian/docs
index 3b56489..81f7b1a 100644
--- a/debian/docs
+++ b/debian/docs
@@ -1 +1,4 @@
-BUGS README TODO HINTS
+BUGS
+README
+TODO
+HINTS
diff --git a/debian/manpages b/debian/manpages
new file mode 100644
index 0000000..73b24b4
--- /dev/null
+++ b/debian/manpages
@@ -0,0 +1 @@
+debian/wmifs.1
diff --git a/debian/menu b/debian/menu
new file mode 100644
index 0000000..f1c8ddb
--- /dev/null
+++ b/debian/menu
@@ -0,0 +1,3 @@
+?package(wmifs):needs="x11" \
+   section="Apps/Net" title="WMifs" \
+   command="/usr/bin/wmifs"
diff --git a/debian/rules b/debian/rules
index d9e5a6e..8e53364 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,50 +6,62 @@
 # Uncomment this to turn on verbose mode.
 # export DH_VERBOSE=1
 
+# This is the debhelper compatability version to use.
+export DH_COMPAT=3
+
+CFLAGS = -O2 -Wall
+INSTALL = install
+INSTALL_FILE    = $(INSTALL) -p -o root -g root -m 644
+INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
+INSTALL_DIR     = $(INSTALL) -p -d -o root -g root -m 755
+
+ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
+CFLAGS += -g
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+INSTALL_PROGRAM += -s
+endif
+
 build: build-stamp
 build-stamp:
 	dh_testdir
 
-	# Add here commands to compile the package.
-	cd wmifs && make CFLAGS="-O2 -g -Wall"
-	cd ..
+	cd wmifs && $(MAKE) CFLAGS="$(CFLAGS)"
 
 	touch build-stamp
 
 clean:
 	dh_testdir
 	dh_testroot
-	rm -f build-stamp
+	rm -f build-stamp install-stamp
 
-	# Add here commands to clean up after the build process.
-	-cd wmifs && $(MAKE) clean
-	cd ..
+	cd wmifs && $(MAKE) clean
 
 	dh_clean
 
-# Build architecture-independent files here.
-binary-indep: build
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build
-#	dh_testversion
+install: build
 	dh_testdir
 	dh_testroot
 	dh_clean -k
 	dh_installdirs
 
-	# Add here commands to install the files into debian/tmp
-	cp wmifs/wmifs debian/tmp/usr/X11R6/bin
-	cp wmifs/sample.wmifsrc debian/tmp/etc/wmifsrc
+	cd wmifs ; $(MAKE) DESTDIR=$(CURDIR)/debian/wmifs prefix=/usr \
+		INSTALL_PROGRAM="$(INSTALL_PROGRAM)" install
+
+	touch install-stamp
 
+binary-indep: build install
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installdirs
 	dh_installdocs
 	dh_installexamples
 	dh_installmenu
 #	dh_installinit
-	dh_installcron
-	dh_installmanpages
-	dh_undocumented wmifs.1x
+	dh_installman
+#	dh_undocumented wmifs.1x
 	dh_installchangelogs CHANGES
 	dh_strip
 	dh_compress
@@ -65,4 +77,4 @@ source diff:
 	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
 binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary
+.PHONY: build clean binary-indep binary-arch binary install
diff --git a/debian/wmifs.1 b/debian/wmifs.1
new file mode 100644
index 0000000..3dbe9c6
--- /dev/null
+++ b/debian/wmifs.1
@@ -0,0 +1,64 @@
+.\" Hey, Emacs!  This is an -*- nroff -*- source file.
+.\" wmifs is copyright 1999-2001 by Jordi Mallach <jordi at debian.org>
+.\" 
+.\" This is free documentation, see the latest version of the GNU
+.\" General Public License for copying conditions. There is NO warranty.
+
+
+.TH WMIFS 1 "December 26, 2001" "wmifs"
+       
+.SH NAME
+wmifs \- a dockable network traffic monitor
+.SH SYNOPSIS
+.B wmifs
+[-d <display name>] [-i <interface name>] [-l] [-w] [-h] [-v]
+
+.SH DESCRIPTION
+WMiFS is a dockable applet for X11 that can monitor all your network
+interfaces. It's designed for WindowMaker's Dock and AfterStep's Wharf,
+but it's not dependant on these window managers and should work with
+any other.
+It can display the net load using a standard bar graph or using a waveform
+mode. It also displays the state of the interface with a group of leds.
+Clicking on the interface name will cycle to the next interface in the
+system. Users can define commands to be executed when the different mouse
+buttons are pressed on the main window.
+
+.SH OPTIONS
+.TP
+.B \-h
+Show summary of options.
+.TP
+.B \-v
+Show version of the program.
+.TP
+.B \-d <display name>
+Use an alternate X display.
+.TP
+.B \-i <interface name>
+Interface that should come up initially when executing wmifs.
+.TP
+.B \-l
+Starts wmifs in lock mode. Useful if combined with \-i, if you want to
+monitor a, for example, ppp device which isn't up when wmifs is started.
+It won't switch to the next available interface.
+.TP
+.B \-w
+Use the waveform graph instead of the classic one.
+
+.SH FILES
+.TP
+.I /etc/wmifsrc
+system wide wmifs configuration file.
+.TP
+.I ~/.wmifsrc
+peruser wmifs configuration file.
+
+.SH AUTHOR
+This manual page was written by Jordi Mallach <jordi at sindominio.net>
+for the Debian GNU/Linux system (but may be used by others).
+
+.SH SEE ALSO
+.PD 0
+.TP
+\fI/usr/share/doc/wmifs\fP
diff --git a/wmifs/Makefile b/wmifs/Makefile
index 4316b3e..299cb35 100755
--- a/wmifs/Makefile
+++ b/wmifs/Makefile
@@ -1,3 +1,10 @@
+
+DESTDIR =
+prefix =/usr/local
+bindir=${prefix}/bin
+CONF=/etc
+
+CC     = gcc
 LIBDIR = -L/usr/X11R6/lib
 LIBS   = -lXpm -lXext -lX11
 OBJS =	wmifs.o \
@@ -5,29 +12,32 @@ OBJS =	wmifs.o \
 		../wmgeneral/misc.o \
 		../wmgeneral/list.o
 
+CFLAGS = -Wall -O2 -g
+
+INSTALL = /usr/bin/install
+INSTALL_DIR     = $(INSTALL) -p -d -o root -g root -m 755
+INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755
+INSTALL_FILE    = $(INSTALL) -p -o root -g root -m 644
 
 .c.o:
-	cc -c -O2 -Wall $< -o $*.o
+	$(CC) -c $(CFLAGS) $< -o $*.o
 
 wmifs: $(OBJS)
-	cc -o wmifs $^ -lXext $(LIBDIR) $(LIBS)
+	$(CC) -o wmifs $^ -lXext $(LIBDIR) $(LIBS)
 
 all:: wmifs
 
 clean::
 	for i in $(OBJS) ; do \
-		rm $$i ; \
+		rm -f $$i ; \
 	done
-	rm wmifs
+	rm -f wmifs
 
 install::
-	cp -f wmifs /usr/local/bin/
-	chmod 755 /usr/local/bin/wmifs
-	chown root:root /usr/local/bin/wmifs
-	cp sample.wmifsrc /etc/wmifsrc
-	chown root:root /etc/wmifsrc
-	chmod 644 /etc/wmifsrc
-	cp -f sample.wmifsrc $(HOME)/.wmifsrc
-	echo "WMiFS-1.3beta installation finished..."
-	echo " "
-	echo "have fun! ;-)"
+	$(INSTALL_DIR) $(DESTDIR)$(bindir)
+	$(INSTALL_DIR) $(DESTDIR)$(CONF)
+	$(INSTALL_PROGRAM) wmifs $(DESTDIR)$(bindir)
+	$(INSTALL_FILE) sample.wmifsrc $(DESTDIR)$(CONF)/wmifsrc
+	@echo "WMiFS-1.3beta installation finished..."
+	@echo " "
+	@echo "have fun! ;-)"
diff --git a/wmifs/wmifs.c b/wmifs/wmifs.c
index 5996b2b..6b756d8 100644
--- a/wmifs/wmifs.c
+++ b/wmifs/wmifs.c
@@ -74,6 +74,18 @@
 	----
 	Changes:
 	---
+	01/15/2002 (Matyas Koszik, koszik at debijan.lonyay.edu.hu)
+		* Patch that fixes segfaults on long interface names.
+	08/31/2001 (Davi Leal, davileal at terra.es)
+		* Patch that cuts long interface names, so they look
+		  good in wmifs. For example, "dummy0" gets displayed
+		  as "dumm0", "vmnet10" as "vmn10", etc.
+	06/16/2001 (Jorge Garc�a, Jorge.Garcia at uv.es)
+		* Added the LockMode, so wmifs doesn't swap to another
+		  interface if the one requested with "-i" isn't up.
+	05/06/2001 (Jordi Mallach, jordi at sindominio.net)
+		* Integrated many patches, fixing issues with suspended
+		  wmifs.
 	07/21/1999 (Stephen Pitts, smpitts at midsouth.rr.com)
 		* Added new constant: BUFFER_SIZE to determine the size
 		  of the buffer used in fgets() operations. Right now,
@@ -185,6 +197,9 @@
 #include "wmifs-master.xpm"
 #include "wmifs-mask.xbm"
 
+/* How often to check for new network interface, in seconds */
+#define CHECK_INTERFACE_INTERVAL 5
+
   /***********/
  /* Defines */
 /***********/
@@ -200,9 +215,9 @@
 #define LED_NET_TX			(5)
 #define LED_NET_POWER		(6)
 
-#define WMIFS_VERSION "1.2.1"
+#define WMIFS_VERSION "1.3b1"
 
-/* the size of the buffer read from /proc/net/* */
+/* the size of the buffer read from /proc/net/ */
 #define BUFFER_SIZE 512
   /**********************/
  /* External Variables */
@@ -214,10 +229,10 @@ extern	char **environ;
  /* Global Variables */
 /********************/
 
-char	*ProgName;
 char	*active_interface = NULL;
 int		TimerDivisor=60;
 int		WaveForm=0;
+int		LockMode=0;
 
   /*****************/
  /* PPP variables */
@@ -254,17 +269,13 @@ void get_ppp_stats(struct ppp_stats *cur);
  /* Main */
 /********/
 
-void main(int argc, char *argv[]) {
+int main(int argc, char *argv[]) {
 
 	int		i;
 	
 
 	/* Parse Command Line */
 
-	ProgName = argv[0];
-	if (strlen(ProgName) >= 5)
-		ProgName += (strlen(ProgName) - 5);
-	
 	for (i=1; i<argc; i++) {
 		char *arg = argv[i];
 
@@ -280,6 +291,9 @@ void main(int argc, char *argv[]) {
 				active_interface = argv[i+1];
 				i++;
 				break;
+			case 'l' :
+				LockMode = 1;
+				break;
 			case 'v' :
 				printversion();
 				exit(0);
@@ -296,6 +310,7 @@ void main(int argc, char *argv[]) {
 	}
 
 	wmifs_routine(argc, argv);
+	return 0;
 }
 
 /*******************************************************************************\
@@ -307,7 +322,7 @@ void main(int argc, char *argv[]) {
 typedef struct {
 
 	char	name[8];
-	int		his[55][2];
+	int	his[55][2];
 	long	istatlast;
 	long	ostatlast;
 	
@@ -341,9 +356,9 @@ void wmifs_routine(int argc, char **argv) {
 	int			stat_online;
 	int			stat_current;
 
-	long		starttime;
-	long		curtime;
-	long		nexttime;
+	time_t		starttime;
+	time_t		curtime;
+	time_t		nexttime;
 
 	long		ipacket, opacket, istat, ostat;
 
@@ -372,17 +387,15 @@ void wmifs_routine(int argc, char **argv) {
 	if (MIDDLE_ACTION) middle_action = strdup(MIDDLE_ACTION);
 	if (RIGHT_ACTION) right_action = strdup(RIGHT_ACTION);
 
-	/* Scan throught  the .rc files */
-	strcpy(temp, "/etc/wmifsrc");
-	parse_rcfile(temp, wmifs_keys);
+	/* Scan throught the .rc files */
+	parse_rcfile("/etc/wmifsrc", wmifs_keys);
 
 	p = getenv("HOME");
 	strcpy(temp, p);
 	strcat(temp, "/.wmifsrc");
 	parse_rcfile(temp, wmifs_keys);
 
-	strcpy(temp, "/etc/wmifsrc.fixed");
-	parse_rcfile(temp, wmifs_keys);
+	parse_rcfile("/etc/wmifsrc.fixed", wmifs_keys);
 
 	openXwindow(argc, argv, wmifs_master_xpm, wmifs_mask_bits, wmifs_mask_width, wmifs_mask_height);
 
@@ -391,13 +404,8 @@ void wmifs_routine(int argc, char **argv) {
 	AddMouseRegion(1, 5, 20, 58, 58);
 
 	starttime = time(0);
-	nexttime = starttime + 5;
+	nexttime = starttime + CHECK_INTERFACE_INTERVAL;
 
-	for (i=0; i<stat_online; i++) {
-		get_statistics(stat_devices[i].name, &ipacket, &opacket, &istat, &ostat);
-		stat_devices[i].istatlast = istat;
-		stat_devices[i].ostatlast = ostat;
-	}
 
 	DrawActiveIFS(stat_devices[stat_current].name);
 
@@ -431,17 +439,14 @@ void wmifs_routine(int argc, char **argv) {
 			
 			stat_devices[i].istatlast = istat;
 			stat_devices[i].ostatlast = ostat;
-			RedrawWindow();
 		}
+		RedrawWindow();
 		
 		if (curtime >= nexttime) {
-			nexttime+=5;
+			nexttime=curtime+CHECK_INTERFACE_INTERVAL;
 
+			DrawStats(&stat_devices[stat_current].his[0][0], 54, 40, 5, 58);
 			for (i=0; i<stat_online; i++) {
-				if (i == stat_current) {
-
-					DrawStats(&stat_devices[i].his[0][0], 54, 40, 5, 58);
-				}
 				if (stillonline(stat_devices[i].name)) {
 					for (j=1; j<54; j++) {
 						stat_devices[i].his[j-1][0] = stat_devices[i].his[j][0];
@@ -465,9 +470,7 @@ void wmifs_routine(int argc, char **argv) {
 				exit(0);
 				break;
 			case ButtonPress:
-				i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
-
-				but_stat = i;
+				but_stat = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
 				break;
 			case ButtonRelease:
 				i = CheckMouseRegion(Event.xbutton.x, Event.xbutton.y);
@@ -480,7 +483,7 @@ void wmifs_routine(int argc, char **argv) {
 						stat_online = checknetdevs();
 						stat_current = 0;
 						for (i=0; i<stat_online; i++) {
-							if (!strncmp(temp, stat_devices[i].name, 4)) {
+							if (!strcmp(temp, stat_devices[i].name)) {
 								stat_current = i;
 							}
 						}
@@ -517,7 +520,7 @@ void wmifs_routine(int argc, char **argv) {
 			}
 		}
 
-		usleep(50000L);
+		usleep(50000L);		/* 50 milliseconds */
 	}
 }
 
@@ -525,7 +528,7 @@ void wmifs_routine(int argc, char **argv) {
 |* void DrawActiveIFS(char *)												   *|
 \*******************************************************************************/
 
-void DrawActiveIFS(char *name) {
+void DrawActiveIFS(char *real_name) {
 
 	/* Cijfers op: 0,65
 	   Letters op: 0,75
@@ -537,11 +540,22 @@ void DrawActiveIFS(char *name) {
 	int		i;
 	int		c;
 	int		k;
+	int		len;
+	char		name[256];
 
 
 	copyXPMArea(5, 84, 30, 10, 5, 5);
 
 
+	strcpy(name,real_name);
+	len = strlen(name);
+	if (len > 5)
+	{
+		for (i=len-5; i<len && !(name[i]>='0' && name[i]<='9'); i++)  ;
+		for (; i<=len; i++) /* '=' to get the '\0' character moved too \*/
+			name[i-(len-5)] = name[i];
+	}
+
 	k = 5;
 	for (i=0; name[i]; i++) {
 		if (i == strlen(name)-1 && strlen(name) <= 4 && name[strlen(name)-1] >= '0' && name[strlen(name)-1] <= '9') {
@@ -661,6 +675,7 @@ int stillonline(char *ifs) {
 		while (fgets(temp, BUFFER_SIZE, fp)) {
 			if (strstr(temp, ifs)) {
 				i = 1; /* Line is alive */
+				break;
 			}
 		}
 		fclose(fp);
@@ -712,6 +727,8 @@ int checknetdevs(void) {
 				strcpy(foundbuffer[devsfound], p);
 				devsfound++;
 			}
+			if (devsfound >= MAX_STAT_DEVICES)
+				break;
 		}
 		fclose(fd);
 	}
@@ -733,7 +750,7 @@ int checknetdevs(void) {
 		}
 	}
 
-	for (i=0, j=0; j<MAX_STAT_DEVICES; i++) {
+	for (i=0, j=0; j<MAX_STAT_DEVICES; i++, j++) {
 
 		while (!stat_devices[j].name[0] && j < MAX_STAT_DEVICES)
 			j++;
@@ -741,8 +758,6 @@ int checknetdevs(void) {
 		if (j < MAX_STAT_DEVICES && i != j) {
 			stat_devices[i] = stat_devices[j];
 		}
-		
-		j++;
 	}
 	i--;
 
@@ -759,8 +774,23 @@ int checknetdevs(void) {
 			i++;
 		}
 	}
+	if (LockMode && active_interface != NULL) {
+		k = 0;
+		for (j=0; j<i; j++)
+			if (!strcmp(stat_devices[j].name, active_interface)) {
+				k = 1;
+				break;
+			}
+		if (!k) {
+			strcpy(stat_devices[i].name, active_interface);
+			for (k=0; k<48; k++) {
+				stat_devices[i].his[k][0] = 0;
+				stat_devices[i].his[k][1] = 0;
+			}
+			devsfound++;
+		}
 
-
+	}
 	return devsfound;
 }
 
@@ -775,7 +805,7 @@ void DrawStats(int *his, int num, int size, int x_left, int y_bottom) {
 	int		*p;
 	int		p0,p1,p2,p3;
 
-	pixels_per_byte = 1*size;
+	pixels_per_byte = size;
 	p = his;
 	for (j=0; j<num; j++) {
 		if (p[0] + p[1] > pixels_per_byte)
@@ -832,6 +862,7 @@ void usage(void) {
 	fprintf(stderr, "\t-d <display name>\n");
 	fprintf(stderr, "\t-h\tthis help screen\n");
 	fprintf(stderr, "\t-i <interface name>\tdefault (as it appears in /proc/net/route)\n");
+	fprintf(stderr, "\t-l\tstarts in lock mode\n");
 	fprintf(stderr, "\t-v\tprint the version number\n");
 	fprintf(stderr, "\t-w\twaveform load\n");
 	fprintf(stderr, "\n");
@@ -862,9 +893,7 @@ void get_ppp_stats(struct ppp_stats *cur) {
 
 	if (ioctl(ppp_h, SIOCGPPPSTATS, &req) < 0) {
 /*		fprintf(stderr, "heyho!\n"); */
-		/* This is an error of some sort! */
 	}
-
 	*cur = req.stats;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmifs.git



More information about the Pkg-wmaker-commits mailing list