From: Jean-Marc Pigeon (Delson) Date: Wed, 10 Jul 2024 23:38:40 +0000 (-0400) Subject: Able to start program emlrec from maild X-Git-Tag: tag-0.3~15 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=d38391e14d45bde937505792209ea4335d501325;p=jmp%2Fmailleur Able to start program emlrec from maild --- diff --git a/app/maild.c b/app/maild.c index e4c4739..4f46f9f 100644 --- a/app/maild.c +++ b/app/maild.c @@ -4,9 +4,11 @@ /* Main SMTP Daemon */ /* */ /********************************************************/ +#include #include #include #include +#include #include #include "subrou.h" @@ -28,10 +30,15 @@ static void task(u_int iteration) { +#define OPEP "maild.c:task" +char *emlrec; +char *argv[10]; pid_t *pidlst; int phase; _Bool proceed; +emlrec=rou_apppath("/usr/bin/emlrec"); +argv[0]=(char *)0; pidlst=(pid_t *)calloc(iteration,sizeof(pid_t)); phase=0; proceed=true; @@ -39,20 +46,23 @@ while (proceed==true) { switch (phase) { case 0 : //looping forever email receiving processes for (int i=0;i " + "(error=<%s>, system trouble?)", + OPEP,emlrec,strerror(errno)); + (void) sleep(2); //to avoid avalanche + } + (void) exit(1); //reached only if trouble break; default : break; @@ -92,6 +102,7 @@ while (proceed==true) { phase++; } (void) free(pidlst); +#undef OPEP } /* diff --git a/lib/subrou.c b/lib/subrou.c index e4cfd62..1c79901 100644 --- a/lib/subrou.c +++ b/lib/subrou.c @@ -18,7 +18,7 @@ //version definition #define VERSION "0.2" -#define RELEASE "1" +#define RELEASE "2" //Public variables PUBLIC int debug=0; //debug level @@ -126,7 +126,7 @@ return newpath; /********************************************************/ void rou_valert(const int dlevel,const char *fmt,va_list ap) -#define DEBMAX 80 +#define DEBMAX 120 { if (debug>=dlevel)