projects
/
NeonServV5.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** VERSION 5.5.0 ***
[NeonServV5.git]
/
src
/
signal.c
diff --git
a/src/signal.c
b/src/signal.c
index 8886e6f471eaa11f360b4b51bbe0b42fbf9e03c8..37f66f38671d98cf9f9a911963e7bb96ad26e905 100644
(file)
--- a/
src/signal.c
+++ b/
src/signal.c
@@
-1,4
+1,4
@@
-/* signal.c - NeonServ v5.
4
+/* signal.c - NeonServ v5.
5
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
@@
-48,7
+48,8
@@
void sighandler(int signum) {
}
static void sigcrash(int signum) {
}
static void sigcrash(int signum) {
- char *coregen = "";
+ char coregen[MAXLEN];
+ coregen[0] = 0;
char *signame;
switch(signum) {
case SIGSEGV:
char *signame;
switch(signum) {
case SIGSEGV:
@@
-68,8
+69,8
@@
static void sigcrash(int signum) {
#ifndef WIN32
char gcore[50];
sprintf(gcore, "gcore %u", getpid());
#ifndef WIN32
char gcore[50];
sprintf(gcore, "gcore %u", getpid());
- system(gcore); //generate core file
-
coregen = "core file generated."
;
+
int sysretn =
system(gcore); //generate core file
+
sprintf(coregen, "core file generated. (%d)", sysretn)
;
putlog(LOGLEVEL_ERROR | LOGLEVEL_INFO, "generated core file.\n");
#endif
char *alertchan = get_string_field("General.alertchan");
putlog(LOGLEVEL_ERROR | LOGLEVEL_INFO, "generated core file.\n");
#endif
char *alertchan = get_string_field("General.alertchan");
@@
-90,9
+91,10
@@
static void sigcrash(int signum) {
}
putlog(LOGLEVEL_INFO, "hard shutdown...\n");
exit_daemon();
}
putlog(LOGLEVEL_INFO, "hard shutdown...\n");
exit_daemon();
- usleep(
1
000000);
+ usleep(
2
000000);
//hard restart
restart_process();
//hard restart
restart_process();
+ exit(0);
}
static void sigexit(int signum) {
}
static void sigexit(int signum) {