Browse Source

ckdb - zombie killer

master
kanoi 9 years ago
parent
commit
c311761b1f
  1. 3
      src/ckdb.c
  2. 2
      src/ckdb.h
  3. 6
      src/ckdb_data.c

3
src/ckdb.c

@ -7252,6 +7252,9 @@ int main(int argc, char **argv)
feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
// Zombie no go zone
signal(SIGCHLD, SIG_IGN);
global_ckp = &ckp; global_ckp = &ckp;
memset(&ckp, 0, sizeof(ckp)); memset(&ckp, 0, sizeof(ckp));
ckp.loglevel = LOG_NOTICE; ckp.loglevel = LOG_NOTICE;

2
src/ckdb.h

@ -52,7 +52,7 @@
#define DB_VLOCK "1" #define DB_VLOCK "1"
#define DB_VERSION "1.0.7" #define DB_VERSION "1.0.7"
#define CKDB_VERSION DB_VERSION"-2.109" #define CKDB_VERSION DB_VERSION"-2.110"
#define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL " - from %s %s() line %d"
#define WHERE_FFL_HERE __FILE__, __func__, __LINE__ #define WHERE_FFL_HERE __FILE__, __func__, __LINE__

6
src/ckdb_data.c

@ -5022,6 +5022,7 @@ int check_events(EVENTS *events)
} else { } else {
if (pid == 0) { if (pid == 0) {
char buf1[16], buf2[16], buf3[16], buf4[16]; char buf1[16], buf2[16], buf3[16], buf4[16];
int e;
snprintf(buf1, sizeof(buf1), "%d", events->id); snprintf(buf1, sizeof(buf1), "%d", events->id);
snprintf(buf2, sizeof(buf2), "%d", limit); snprintf(buf2, sizeof(buf2), "%d", limit);
snprintf(buf3, sizeof(buf3), "%d", tyme); snprintf(buf3, sizeof(buf3), "%d", tyme);
@ -5030,10 +5031,11 @@ int check_events(EVENTS *events)
execl(cmd, cmd, buf1, name, buf2, buf3, buf4, execl(cmd, cmd, buf1, name, buf2, buf3, buf4,
events->createinet, st, events->createinet, st,
cause_str(cause), NULL); cause_str(cause), NULL);
e = errno;
LOGERR("%s() ALERT fork failed to execute (%d)", LOGERR("%s() ALERT fork failed to execute (%d)",
__func__, errno); __func__, e);
FREENULL(st); FREENULL(st);
exit(0); _exit(0);
} }
} }
return lifetime; return lifetime;

Loading…
Cancel
Save