mirror of
https://github.com/nzbget/nzbget.git
synced 2026-01-06 04:58:54 -05:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user