#include "debug.h"
#include "frontends/Timeout.h"
+#include <boost/bind.hpp>
+
#include <cerrno>
#include <sys/types.h>
#include <sys/wait.h>
} else {
retval_ = waitForChild();
}
-
+
return retval_;
}
void Forkedcall::emitSignal()
{
if (signal_.get()) {
- signal_->emit(command_, pid_, retval_);
+ signal_->operator()(command_, pid_, retval_);
}
}
namespace {
-class Murder : public SigC::Object {
+class Murder : public boost::signals::trackable {
public:
//
static void killItDead(int secs, pid_t pid)
: timeout_(0), pid_(pid)
{
timeout_ = new Timeout(1000*secs, Timeout::ONETIME);
- timeout_->timeout.connect(SigC::slot(this, &Murder::kill));
+ timeout_->timeout.connect(boost::bind(&Murder::kill, this));
timeout_->start();
}
wait = false;
} else if (WIFSIGNALED(status)) {
lyxerr << "LyX: Child didn't catch signal "
- << WTERMSIG(status)
+ << WTERMSIG(status)
<< "and died. Too bad." << endl;
wait = false;
} else if (WIFSTOPPED(status)) {
lyxerr << "LyX: Child (pid: " << pid_
<< ") stopped on signal "
- << WSTOPSIG(status)
+ << WSTOPSIG(status)
<< ". Waiting for child to finish." << endl;
} else {
lyxerr << "LyX: Something rotten happened while "
pid_t Forkedcall::generateChild()
{
const int MAX_ARGV = 255;
- char *syscmd = 0;
+ char *syscmd = 0;
char *argv[MAX_ARGV];
string childcommand(command_); // copy
// reinit
more = !rest.empty();
- if (more)
+ if (more)
rest = split(rest, childcommand, ' ');
}
argv[index] = 0;