projects
/
NeonServV5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed crash management
[NeonServV5.git]
/
src
/
main.c
diff --git
a/src/main.c
b/src/main.c
index c5413d9ef37f12bb82ea06d083d618d585e5e5a6..f567e93f3e92ec5eaf0cd4b1e54caa1bea401cca 100644
(file)
--- a/
src/main.c
+++ b/
src/main.c
@@
-116,11
+116,13
@@
void * thread_main(void *arg) {
socket_wait = time(0) + SOCKET_SELECT_TIME;
do {
if(!socket_loop(SOCKET_SELECT_TIME)) {
socket_wait = time(0) + SOCKET_SELECT_TIME;
do {
if(!socket_loop(SOCKET_SELECT_TIME)) {
+ if(!running) break;
putlog(LOGLEVEL_ERROR, "No more active Bots... shutting down.\n");
cleanup();
exit(0);
}
} while(time(0) < socket_wait);
putlog(LOGLEVEL_ERROR, "No more active Bots... shutting down.\n");
cleanup();
exit(0);
}
} while(time(0) < socket_wait);
+ if(!running) break;
clearTempUsers();
destroyEvents();
mysql_free();
clearTempUsers();
destroyEvents();
mysql_free();
@@
-147,6
+149,7
@@
int getCurrentThreadID() {
#endif
void exit_daemon() {
#endif
void exit_daemon() {
+ running = 0;
if(daemonized) {
remove(PID_FILE);
}
if(daemonized) {
remove(PID_FILE);
}