[Pkg-wmaker-commits] [wmppp.app] 42/120: wmppp.app: Stampfile handling.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 27 12:04:34 UTC 2015


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

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

commit 4b3f14715a26c20767fc8483b8403d347d13d11e
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Sun Sep 14 12:57:18 2014 -0500

    wmppp.app: Stampfile handling.
    
    This patch adds support for "stampfile" in config file, as described in
    manual page.
    
    Based on the patch by Juan Cespedes <cespedes at debian.org>.
    See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=97509.
---
 wmppp/wmppp.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/wmppp/wmppp.c b/wmppp/wmppp.c
index 7287aa8..93adefa 100644
--- a/wmppp/wmppp.c
+++ b/wmppp/wmppp.c
@@ -192,7 +192,7 @@
 #define SPEED_ACTION (NULL)
 #define IFDOWN_ACTION (NULL)
 
-#define STAMP_FILE "/var/run/ppp0.pid"
+#define STAMP_FILE_PRE "/var/run/wmppp."
 
 /* Defines voor alle coordinate */
 
@@ -362,6 +362,7 @@ char	*start_action = NULL;
 char	*stop_action = NULL;
 char	*speed_action = NULL;
 char	*ifdown_action = NULL;
+char    *stamp_file = NULL;
 
 void wmppp_routine(int argc, char **argv) {
 
@@ -370,6 +371,7 @@ void wmppp_routine(int argc, char **argv) {
 		{ "stop", &stop_action },
 		{ "speed", &speed_action },
 		{ "ifdown", &ifdown_action },
+		{ "stampfile", &stamp_file },
 		{ NULL, NULL }
 	};
 
@@ -411,6 +413,11 @@ void wmppp_routine(int argc, char **argv) {
 	if (STOP_ACTION) stop_action = strdup(STOP_ACTION);
 	if (SPEED_ACTION) speed_action = strdup(SPEED_ACTION);
 	if (IFDOWN_ACTION) ifdown_action = strdup(IFDOWN_ACTION);
+	if (STAMP_FILE_PRE) {
+           sprintf (temp, "%s%s", STAMP_FILE_PRE, active_interface);
+           stamp_file = strdup (temp);
+	}
+
 
 	strcpy(temp, "/etc/wmppprc");
 	parse_rcfile(temp, wmppp_keys);
@@ -483,7 +490,7 @@ void wmppp_routine(int argc, char **argv) {
 				if (!starttime) {
 					starttime = currenttime;
 
-					if (stat(STAMP_FILE, &st) == 0)
+					if (stat(stamp_file, &st) == 0)
 						starttime = st.st_mtime;
 
 					SetOnLED(LED_PPP_POWER);

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



More information about the Pkg-wmaker-commits mailing list