mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Make the shell module generate error messages if fork() or pipe() fail
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1369 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -14,11 +14,18 @@ class CShellMod;
|
||||
|
||||
class CShellSock : public CExecSock {
|
||||
public:
|
||||
CShellSock(CShellMod* pShellMod, CClient* pClient, const CString& sExec) : CExecSock(sExec) {
|
||||
CShellSock(CShellMod* pShellMod, CClient* pClient, const CString& sExec) : CExecSock() {
|
||||
EnableReadLine();
|
||||
m_pParent = pShellMod;
|
||||
m_pClient = pClient;
|
||||
|
||||
if (Execute(sExec) == -1) {
|
||||
CString s = "Failed to execute: ";
|
||||
s += strerror(errno);
|
||||
ReadLine(s);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get rid of that write fd, we aren't going to use it
|
||||
// (And clients expecting input will fail this way).
|
||||
close(GetWSock());
|
||||
|
||||
Reference in New Issue
Block a user