fixed compilation without threads and fixed some warnings
[NeonServV5.git] / src / signal.c
index 1eb2383e8982069f2955e1f705abc47c9743cf0c..cf6934269403b22d4820c8746352d38578d17999 100644 (file)
@@ -48,7 +48,8 @@ void sighandler(int signum) {
 }
 
 static void sigcrash(int signum) {
-    char *coregen = "";
+    char coregen[MAXLEN];
+       coregen[0] = 0;
     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());
-    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");