X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbf456aa8952c6d2d3edeea1208b0e3159a3cb8d..02a1dfbae942c883d8651e34dcfbc5153aabc56e:/src/unix/utilsunx.cpp diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index 83e04373a4..b372b21c34 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -155,7 +155,7 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc) int err = kill((pid_t)pid, (int)sig); if ( rc ) { - switch ( err ) + switch ( errno ) { case 0: *rc = wxKILL_OK; @@ -650,6 +650,15 @@ long wxExecute(wxChar **argv, if ( fd != STDERR_FILENO ) close(fd); } + +#ifndef __VMS + if ( flags & wxEXEC_MAKE_GROUP_LEADER ) + { + // Set process group to child process' pid. Then killing -pid + // of the parent will kill the process and all of its children. + setsid(); + } +#endif } // redirect stdio, stdout and stderr