mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
switch to execvp, as system() does its own fork and can cause process to detach completely if parent process dies
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@677 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -342,7 +342,14 @@ int CExecSock::popen2(int & iReadFD, int & iWriteFD, const CString & sCommand) {
|
||||
dup2(rpipes[1], 2);
|
||||
close(wpipes[0]);
|
||||
close(rpipes[1]);
|
||||
system( sCommand.c_str() );
|
||||
char *pArgv[] =
|
||||
{
|
||||
"sh",
|
||||
"-c",
|
||||
(char *)sCommand.c_str(),
|
||||
NULL
|
||||
};
|
||||
execvp( "sh", pArgv );
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user