projects
/
NeonServV5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
acf3987
)
fixed crash management
author
pk910
<philipp@zoelle1.de>
Thu, 16 Feb 2012 18:25:33 +0000
(19:25 +0100)
committer
pk910
<philipp@zoelle1.de>
Thu, 16 Feb 2012 19:18:56 +0000
(20:18 +0100)
src/main.c
patch
|
blob
|
history
src/signal.c
patch
|
blob
|
history
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)) {
+ if(!running) break;
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();
@@
-147,6
+149,7
@@
int getCurrentThreadID() {
#endif
void exit_daemon() {
+ running = 0;
if(daemonized) {
remove(PID_FILE);
}
diff --git
a/src/signal.c
b/src/signal.c
index 8886e6f471eaa11f360b4b51bbe0b42fbf9e03c8..1eb2383e8982069f2955e1f705abc47c9743cf0c 100644
(file)
--- a/
src/signal.c
+++ b/
src/signal.c
@@
-90,9
+90,10
@@
static void sigcrash(int signum) {
}
putlog(LOGLEVEL_INFO, "hard shutdown...\n");
exit_daemon();
- usleep(
1
000000);
+ usleep(
2
000000);
//hard restart
restart_process();
+ exit(0);
}
static void sigexit(int signum) {