added modifier <O> to command <-E/--edit> for editing of post-processor-queue; following subcommands are supported: <+/-offset>, <T>, <B>, <D>; subcommand <D> supports deletion of queued post-jobs and active job as well; deletion of active job means the cancelling of par-check/repair or terminating of post-processing-script (including child processes of the script); updated remote-server to support new edit-subcommands in XML/JSON-RPC

This commit is contained in:
Andrey Prygunkov
2009-05-03 17:14:52 +00:00
parent 93ebcbac6c
commit bbdfb2b4f2
12 changed files with 353 additions and 117 deletions

View File

@@ -336,6 +336,9 @@ int ScriptController::Execute()
else if (pid == 0)
{
// here goes the second instance
// create new process group (see Terminate() where it is used)
setsid();
// close up the "read" end
close(pipein);
@@ -463,7 +466,13 @@ void ScriptController::Terminate()
#ifdef WIN32
BOOL bOK = TerminateProcess(m_hProcess, -1);
#else
bool bOK = kill(m_hProcess, SIGKILL) == 0;
pid_t hKillProcess = m_hProcess;
if (getpgid(hKillProcess) == hKillProcess)
{
// if the child process has its own group (setsid() was successful), kill the whole group
hKillProcess = -hKillProcess;
}
bool bOK = kill(hKillProcess, SIGKILL) == 0;
#endif
if (bOK)