version 1.1.1.1.2.4, 2011/11/29 23:31:57
|
version 1.1.1.1.2.5, 2011/11/30 00:12:30
|
Line 27 main(int argc, char **argv)
|
Line 27 main(int argc, char **argv)
|
register int i; |
register int i; |
sqlite3 *acc = NULL, *pub = NULL; |
sqlite3 *acc = NULL, *pub = NULL; |
FILE *logg = NULL; |
FILE *logg = NULL; |
|
int sock, ret = 0; |
|
|
strlcpy(szCfgName, DEFAULT_CONFIG, sizeof szCfgName); |
strlcpy(szCfgName, DEFAULT_CONFIG, sizeof szCfgName); |
while ((ch = getopt(argc, argv, "hvc:")) != -1) |
while ((ch = getopt(argc, argv, "hvc:")) != -1) |
Line 58 main(int argc, char **argv)
|
Line 59 main(int argc, char **argv)
|
return 2; |
return 2; |
} |
} |
acc = call.OpenACC(&cfg); |
acc = call.OpenACC(&cfg); |
if (!acc) | if (!acc) { |
| ret = 3; |
goto end; |
goto end; |
|
} |
pub = call.OpenPUB(&cfg); |
pub = call.OpenPUB(&cfg); |
if (!pub) | if (!pub) { |
| ret = 3; |
goto end; |
goto end; |
|
} |
logg = call.OpenLOG(&cfg); |
logg = call.OpenLOG(&cfg); |
if (!logg) | if (!logg) { |
| ret = 3; |
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; |
goto end; |
goto end; |
} |
} |
|
|
VERB(2) printf("Service is ready for start engine ...\n"); |
VERB(2) printf("Service is ready for start engine ...\n"); |
|
|
|
if ((sock = srv_Socket(&cfg)) == -1) { |
|
ret = 4; |
|
goto end; |
|
} |
|
|
|
srv_Close(sock); |
end: |
end: |
call.CloseLOG(logg); |
call.CloseLOG(logg); |
call.ClosePUB(pub); |
call.ClosePUB(pub); |
Line 81 end:
|
Line 95 end:
|
for (i = 0; i < 3; i++) |
for (i = 0; i < 3; i++) |
mqttUnloadRTLM(i); |
mqttUnloadRTLM(i); |
UnloadConfig(&cfg); |
UnloadConfig(&cfg); |
return 0; | return ret; |
} |
} |