mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Fix some gcc 4.3 warnings
These are mostly string casts, handling function's return value and some weird warning about missing spaces on empty while loops. These were reported by and fixed with Marcus Rueckert <darix@opensu.se>. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@904 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -362,12 +362,22 @@ int CExecSock::popen2(int & iReadFD, int & iWriteFD, const CString & sCommand) {
|
||||
iReadFD = -1;
|
||||
iWriteFD = -1;
|
||||
|
||||
pipe(rpipes);
|
||||
pipe(wpipes);
|
||||
if (pipe(rpipes) < 0)
|
||||
return -1;
|
||||
|
||||
if (pipe(wpipes) < 0) {
|
||||
close(rpipes[0]);
|
||||
close(rpipes[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int iPid = fork();
|
||||
|
||||
if (iPid == -1) {
|
||||
close(rpipes[0]);
|
||||
close(rpipes[1]);
|
||||
close(wpipes[0]);
|
||||
close(wpipes[1]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -379,14 +389,14 @@ int CExecSock::popen2(int & iReadFD, int & iWriteFD, const CString & sCommand) {
|
||||
dup2(rpipes[1], 2);
|
||||
close(wpipes[0]);
|
||||
close(rpipes[1]);
|
||||
char * const pArgv[] =
|
||||
const char * pArgv[] =
|
||||
{
|
||||
"sh",
|
||||
"-c",
|
||||
(char *)sCommand.c_str(),
|
||||
sCommand.c_str(),
|
||||
NULL
|
||||
};
|
||||
execvp( "sh", pArgv );
|
||||
execvp("sh", (char * const *) pArgv);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user