* \author Asger Alstrup Nielsen
* \author Angus Leeming
*
- * A class for the control of child processes launched using
+ * A class for the control of child processes launched using
* fork() and execvp().
*/
#include "forkedcontr.h"
#include "forkedcall.h"
#include "lyxfunctional.h"
-#include "frontends/Timeout.h"
#include "debug.h"
+#include "frontends/Timeout.h"
+
+#include <boost/bind.hpp>
+
#include <cerrno>
#include <cstdlib>
#include <unistd.h>
ForkedcallsController::ForkedcallsController()
{
- timeout_ = new Timeout(100, Timeout::CONTINUOUS);
-
+ timeout_ = new Timeout(100, Timeout::ONETIME);
+
timeout_->timeout
- .connect(SigC::slot(this, &ForkedcallsController::timer));
+ .connect(boost::bind(&ForkedcallsController::timer, this));
}
Forkedcall * call = new Forkedcall(newcall);
forkedCalls.push_back(call);
- childrenChanged.emit();
+ childrenChanged();
}
bool remove_it = false;
if (waitrpid == -1) {
- lyxerr << "LyX: Error waiting for child: "
+ lyxerr << "LyX: Error waiting for child: "
<< strerror(errno) << endl;
// Child died, so pretend it returned 1
remove_it = true;
} else if (WIFSTOPPED(stat_loc)) {
- lyxerr << "LyX: Child (pid: " << pid
+ lyxerr << "LyX: Child (pid: " << pid
<< ") stopped on signal "
- << WSTOPSIG(stat_loc)
+ << WSTOPSIG(stat_loc)
<< ". Waiting for child to finish." << endl;
} else {
}
}
- if (forkedCalls.empty()) {
- timeout_->stop();
+ if (!forkedCalls.empty()) {
+ timeout_->start();
}
if (start_size != forkedCalls.size())
- childrenChanged.emit();
+ childrenChanged();
}