1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge branch '5.5' into 10.0

This commit is contained in:
Sergei Golubchik
2015-03-06 18:41:32 +01:00
21 changed files with 245 additions and 67 deletions

View File

@ -125,7 +125,7 @@ extern "C" void handle_abort(int sig)
message("Got signal %d, child_pid: %d, sending ABRT", sig, child_pid);
if (child_pid > 0) {
kill (-child_pid, SIGABRT); // Don't wait for it to terminate
kill(-child_pid, SIGABRT); // Don't wait for it to terminate
}
}
@ -226,6 +226,18 @@ int main(int argc, char* const argv[] )
sleep(1);
}
/*
Child: Make this process it's own process group to be able to kill
it and any its children that hasn't changed a group themselves)
Parent: Detach from the parent's process group, so that killing a parent
group wouldn't kill us (if we're killed, there's no one to kill our child
processes that run in their own process group). There's a loop below
that monitors the parent, it's enough.
*/
setpgid(0, 0);
if (child_pid == 0)
{
close(pfd[0]); // Close unused read end
@ -236,10 +248,6 @@ int main(int argc, char* const argv[] )
signal(SIGHUP, SIG_DFL);
signal(SIGCHLD, SIG_DFL);
// Make this process it's own process group to be able to kill
// it and any childs(that hasn't changed group themself)
setpgid(0, 0);
if (nocore)
{
struct rlimit corelim = { 0, 0 };