From 9834bcf821d6b38fcfe8850fabe9b82874866796 Mon Sep 17 00:00:00 2001 From: "Jean-Marc Pigeon (Delson)" Date: Tue, 15 Jul 2025 19:37:33 -0400 Subject: [PATCH] Adjusting receiver to set all remote.links in datbase at 0 --- app/Makefile | 2 ++ app/receiver.c | 18 ++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/app/Makefile b/app/Makefile index 5fc92cd..0de9deb 100644 --- a/app/Makefile +++ b/app/Makefile @@ -92,6 +92,8 @@ chkspf.o: chkspf.c \ receiver.o:receiver.c \ ../lib/modrec.h \ + ../lib/gessql.h \ + ../lib/devsql.h \ ../lib/unitls.h \ ../lib/unisig.h \ ../lib/uniprc.h \ diff --git a/app/receiver.c b/app/receiver.c index 689348e..4585431 100644 --- a/app/receiver.c +++ b/app/receiver.c @@ -15,6 +15,8 @@ #include "uniprc.h" #include "unisig.h" #include "unitls.h" +#include "devsql.h" +#include "gessql.h" #include "modrec.h" #define RECNAME "receiver" @@ -36,11 +38,13 @@ int main(int argc,char *argv[]) { int status; ARGTYP *params; +SQLPTR *sqlptr; int phase; _Bool proceed; status=0; params=(ARGTYP *)0; +sqlptr=(SQLPTR *)0; phase=0; proceed=true; while (proceed==true) { @@ -70,11 +74,21 @@ while (proceed==true) { phase=999; //direct exit } break; - case 3 : //doing main task + case 3 : //opening data base + if ((sqlptr=sql_opensql())==(SQLPTR *)0) { + (void) fprintf(stdout,"Unable to reach database server (aborting!)\n"); + phase=999; //Aborting + } + break; + case 4 : //make sur link are all zero in DB + (void) sql_droplinks(sqlptr); + sqlptr=sql_closesql(sqlptr); + break; + case 5 : //doing main task if (prc_locking(appname,true,5)==false) phase=999; //Trouble trouble break; - case 4 : //doing main task + case 6 : //doing main task (void) rec_handlesmtp(params->argc,params->argv); (void) prc_locking(appname,false,1); break; -- 2.47.3