]> git.webhop.me Git - msgbox.git/commitdiff
use new pzapit to lock & unlock RC
authorGetAway <get-away@t-online.de>
Sat, 10 Dec 2016 20:58:16 +0000 (21:58 +0100)
committersvenhoefer <svenhoefer@svenhoefer.com>
Sun, 11 Dec 2016 19:20:36 +0000 (20:20 +0100)
msgbox.c

index dc51723d3972ee9cb33cf1c228d900f4c63de91d..1470461d408e4d201cbed8033acdae0fc0ffba78 100644 (file)
--- a/msgbox.c
+++ b/msgbox.c
@@ -10,7 +10,7 @@
 #include "gfx.h"
 #include "txtform.h" 
 
-#define M_VERSION 1.25
+#define M_VERSION 1.26
 
 #define NCF_FILE       "/var/tuxbox/config/neutrino.conf"
 #define HDF_FILE       "/tmp/.msgbox_hidden"
@@ -53,6 +53,7 @@ char nstr[BUFSIZE]={0};
 char *trstr=NULL;
 const char INST_FILE[]="/tmp/rc.locked";
 int instance=0;
+int rclocked=0;
 int stride;
 
 int get_instance(void)
@@ -74,6 +75,10 @@ void put_instance(int pval)
 
        if(pval)
        {
+               if (!rclocked) {
+                       rclocked=1;
+                       system("pzapit -lockrc > /dev/null");
+               }
                if((fh=fopen(INST_FILE,"w"))!=NULL)
                {
                        fputc(pval,fh);
@@ -83,6 +88,7 @@ void put_instance(int pval)
        else
        {
                remove(INST_FILE);
+               system("pzapit -unlockrc > /dev/null");
        }
 }