version 1.2.2.7, 2012/05/05 14:51:02
|
version 1.2.2.10, 2012/06/26 14:51:33
|
Line 9 io_enableDEBUG;
|
Line 9 io_enableDEBUG;
|
|
|
cfg_root_t cfg; |
cfg_root_t cfg; |
sessions_t Sessions; |
sessions_t Sessions; |
pubs_t Pubs; |
|
sched_root_task_t *root; |
sched_root_task_t *root; |
sqlite3 *acc, *pub; |
sqlite3 *acc, *pub; |
FILE *logg; |
FILE *logg; |
Line 44 sigHand(int sig)
|
Line 43 sigHand(int sig)
|
} |
} |
|
|
ioLIBERR(cfg); |
ioLIBERR(cfg); |
|
case SIGINT: |
case SIGTERM: |
case SIGTERM: |
ioDEBUG(1, "Terminate MQTT service in progress"); |
ioDEBUG(1, "Terminate MQTT service in progress"); |
Kill++; |
Kill++; |
Line 68 main(int argc, char **argv)
|
Line 68 main(int argc, char **argv)
|
ait_val_t v; |
ait_val_t v; |
|
|
TAILQ_INIT(&Sessions); |
TAILQ_INIT(&Sessions); |
TAILQ_INIT(&Pubs); |
|
|
|
strlcpy(szCfgName, DEFAULT_CONFIG, sizeof szCfgName); |
strlcpy(szCfgName, DEFAULT_CONFIG, sizeof szCfgName); |
while ((ch = getopt(argc, argv, "hvbc:")) != -1) |
while ((ch = getopt(argc, argv, "hvbc:")) != -1) |
Line 99 main(int argc, char **argv)
|
Line 98 main(int argc, char **argv)
|
for (i = 0; i < 3; i++) |
for (i = 0; i < 3; i++) |
if (!mqttLoadRTLM(&cfg, i)) { |
if (!mqttLoadRTLM(&cfg, i)) { |
printf("Error:: Can't load RTL module\n"); |
printf("Error:: Can't load RTL module\n"); |
while (i--) | mqttUnloadRTLM(acc); |
mqttUnloadRTLM(i); | mqttUnloadRTLM(pub); |
| mqttUnloadRTLM(logg); |
cfgUnloadConfig(&cfg); |
cfgUnloadConfig(&cfg); |
closelog(); |
closelog(); |
return 2; |
return 2; |
Line 121 main(int argc, char **argv)
|
Line 121 main(int argc, char **argv)
|
goto end; |
goto end; |
} |
} |
|
|
|
|
if (mqttMkDir(&cfg)) { |
if (mqttMkDir(&cfg)) { |
printf("Error:: in statedir #%d - %s\n", errno, strerror(errno)); |
printf("Error:: in statedir #%d - %s\n", errno, strerror(errno)); |
ret = 3; |
ret = 3; |
Line 158 main(int argc, char **argv)
|
Line 159 main(int argc, char **argv)
|
sigemptyset(&sa.sa_mask); |
sigemptyset(&sa.sa_mask); |
sa.sa_handler = sigHand; |
sa.sa_handler = sigHand; |
sigaction(SIGHUP, &sa, NULL); |
sigaction(SIGHUP, &sa, NULL); |
|
sigaction(SIGINT, &sa, NULL); |
sigaction(SIGTERM, &sa, NULL); |
sigaction(SIGTERM, &sa, NULL); |
sigaction(SIGCHLD, &sa, NULL); |
sigaction(SIGCHLD, &sa, NULL); |
sigaction(SIGPIPE, &sa, NULL); |
sigaction(SIGPIPE, &sa, NULL); |
Line 192 end: /* free all resources */
|
Line 194 end: /* free all resources */
|
call.CloseLOG(logg); |
call.CloseLOG(logg); |
call.ClosePUB(pub); |
call.ClosePUB(pub); |
call.CloseACC(acc); |
call.CloseACC(acc); |
for (i = 0; i < 3; i++) | mqttUnloadRTLM(acc); |
mqttUnloadRTLM(i); | mqttUnloadRTLM(pub); |
closelog(); | mqttUnloadRTLM(logg); |
cfgUnloadConfig(&cfg); |
cfgUnloadConfig(&cfg); |
|
closelog(); |
return ret; |
return ret; |
} |
} |