execm first working zip version

This commit is contained in:
dockes
2009-10-14 06:21:44 +00:00
parent 3fcde55ff4
commit ce0078081a
7 changed files with 157 additions and 43 deletions
+12 -2
View File
@@ -226,7 +226,6 @@ int ExecCmd::startExec(const string &cmd, const list<string>& args,
NetconCli *iclicon = new NetconCli();
iclicon->setconn(m_pipein[1]);
m_tocmd = NetconP(iclicon);
m_pipein[1] = 0;
}
if (has_output) {
close(m_pipeout[1]);
@@ -234,7 +233,6 @@ int ExecCmd::startExec(const string &cmd, const list<string>& args,
NetconCli *oclicon = new NetconCli();
oclicon->setconn(m_pipeout[0]);
m_fromcmd = NetconP(oclicon);
m_pipeout[0] = -1;
}
/* Don't want to undo what we just did ! */
@@ -361,6 +359,18 @@ int ExecCmd::doexec(const string &cmd, const list<string>& args,
}
}
LOGDEB0(("ExecCmd::doexec: selectloop returned %d\n", ret));
// The netcons don't take ownership of the fds: we have to close them
// (have to do it before wait, this may be the signal the child is
// waiting for exiting).
if (input) {
close(m_pipein[1]);
m_pipein[1] = -1;
}
if (output) {
close(m_pipeout[0]);
m_pipeout[0] = -1;
}
}
// Normal return: deactivate cleaner, wait() will do the cleanup