|
version 1.1.1.1.2.14, 2011/12/29 14:13:13
|
version 1.1.1.1.2.15, 2012/01/24 10:18:45
|
|
Line 11 sl_config cfg;
|
Line 11 sl_config cfg;
|
| sessions_t Sessions; |
sessions_t Sessions; |
| sched_root_task_t *root; |
sched_root_task_t *root; |
| sqlite3 *acc, *pub; |
sqlite3 *acc, *pub; |
| pthread_mutex_t mtx_sess; | pthread_mutex_t mtx_sess, mtx_pub; |
| FILE *logg; |
FILE *logg; |
| extern char compiled[], compiledby[], compilehost[]; |
extern char compiled[], compiledby[], compilehost[]; |
| static char szCfgName[MAXPATHLEN]; |
static char szCfgName[MAXPATHLEN]; |
|
Line 93 main(int argc, char **argv)
|
Line 93 main(int argc, char **argv)
|
| return 1; |
return 1; |
| } |
} |
| pthread_mutex_init(&mtx_sess, NULL); |
pthread_mutex_init(&mtx_sess, NULL); |
| |
pthread_mutex_init(&mtx_pub, NULL); |
| openlog("mqttd", LOG_PID | LOG_CONS, LOG_DAEMON); |
openlog("mqttd", LOG_PID | LOG_CONS, LOG_DAEMON); |
| for (i = 0; i < 3; i++) |
for (i = 0; i < 3; i++) |
| if (!mqttLoadRTLM(&cfg, i)) { |
if (!mqttLoadRTLM(&cfg, i)) { |
|
Line 101 main(int argc, char **argv)
|
Line 102 main(int argc, char **argv)
|
| mqttUnloadRTLM(i); |
mqttUnloadRTLM(i); |
| UnloadConfig(&cfg); |
UnloadConfig(&cfg); |
| closelog(); |
closelog(); |
| |
pthread_mutex_destroy(&mtx_pub); |
| pthread_mutex_destroy(&mtx_sess); |
pthread_mutex_destroy(&mtx_sess); |
| return 2; |
return 2; |
| } |
} |
|
Line 193 end:
|
Line 195 end:
|
| mqttUnloadRTLM(i); |
mqttUnloadRTLM(i); |
| closelog(); |
closelog(); |
| UnloadConfig(&cfg); |
UnloadConfig(&cfg); |
| |
pthread_mutex_destroy(&mtx_pub); |
| pthread_mutex_destroy(&mtx_sess); |
pthread_mutex_destroy(&mtx_sess); |
| return ret; |
return ret; |
| } |
} |