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:
1 parent
db9694836e
commit
b490b12058
5 files changed
+35
-19
No files matched your search
+15
-5
@@ -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