[Pkg-wmaker-commits] [wmifs] 07/118: wmifs: Add lock mode.

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


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

dtorrance-guest pushed a commit to branch master
in repository wmifs.

commit 959f87d45886a84a317c1d6d58457ebfeb7821b1
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Wed Oct 22 16:34:35 2014 -0500

    wmifs: Add lock mode.
    
    Patch by Jorge García <Jorge.Garcia at uv.es>  First appeared in Debian package
    version 1.3b1-7, revised in 1.3b1-8.
    
    For more information, see:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=26870
---
 wmifs/wmifs.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/wmifs/wmifs.c b/wmifs/wmifs.c
index cfbcc6a..0cdb74e 100644
--- a/wmifs/wmifs.c
+++ b/wmifs/wmifs.c
@@ -74,6 +74,9 @@
 	----
 	Changes:
 	---
+	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.
@@ -224,6 +227,7 @@ char	*ProgName;
 char	*active_interface = NULL;
 int		TimerDivisor=60;
 int		WaveForm=0;
+int		LockMode=0;
 
   /*****************/
  /* PPP variables */
@@ -286,6 +290,9 @@ int main(int argc, char *argv[]) {
 				active_interface = argv[i+1];
 				i++;
 				break;
+			case 'l' :
+				LockMode = 1;
+				break;
 			case 'v' :
 				printversion();
 				exit(0);
@@ -768,8 +775,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;
 }
 
@@ -841,6 +863,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");

-- 
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