version 1.2.2.3, 2012/04/15 21:48:23
|
version 1.2.2.6, 2012/04/24 13:54:50
|
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; |
pthread_mutex_t mtx_sess, mtx_pub; |
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]; |
intptr_t Kill; | volatile intptr_t Kill; |
|
|
|
|
static void |
static void |
Line 34 static void
|
Line 35 static void
|
sigHand(int sig) |
sigHand(int sig) |
{ |
{ |
int stat; |
int stat; |
|
struct tagSession *sess; |
|
|
switch (sig) { |
switch (sig) { |
case SIGHUP: |
case SIGHUP: |
Line 43 sigHand(int sig)
|
Line 45 sigHand(int sig)
|
break; |
break; |
} |
} |
|
|
syslog(LOG_ERR, "Error:: can't reload #%d - %s", cfg_GetErrno(), cfg_GetError()); | ioLIBERR(cfg); |
case SIGTERM: |
case SIGTERM: |
ioDEBUG(1, "Terminate MQTT service in progress"); |
ioDEBUG(1, "Terminate MQTT service in progress"); |
Kill++; |
Kill++; |
|
|
|
SESS_LOCK; |
|
TAILQ_FOREACH(sess, &Sessions, sess_node) |
|
if (sess->sess_tid) |
|
pthread_cancel(sess->sess_tid); |
|
SESS_UNLOCK; |
break; |
break; |
case SIGCHLD: |
case SIGCHLD: |
while (waitpid(-1, &stat, WNOHANG) > 0); |
while (waitpid(-1, &stat, WNOHANG) > 0); |
Line 68 main(int argc, char **argv)
|
Line 76 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) |