#include "forkedcontr.h"
#include "forkedcall.h"
-#include "lyxfunctional.h"
#include "debug.h"
+#include <boost/bind.hpp>
#include <boost/iterator/indirect_iterator.hpp>
#include <cerrno>
#include <unistd.h>
#include <sys/wait.h>
+using boost::bind;
+
using std::endl;
+using std::equal_to;
using std::find_if;
using std::string;
ForkedcallsController & fcc = ForkedcallsController::get();
// Be safe
- if (fcc.current_child+1 >= fcc.reaped_children.size())
+ typedef vector<ForkedcallsController::Data>::size_type size_type;
+ if (size_type(fcc.current_child + 1) >= fcc.reaped_children.size())
return;
ForkedcallsController::Data & store =
iterator begin = boost::make_indirect_iterator(forkedCalls.begin());
iterator end = boost::make_indirect_iterator(forkedCalls.end());
iterator it = find_if(begin, end,
- lyx::compare_memfun(&Forkedcall::pid, pid));
-
+ bind(equal_to<pid_t>(),
+ bind(&Forkedcall::pid, _1),
+ pid));
return it.base();
}
Data & store = reaped_children[i];
if (store.pid == -1) {
- lyxerr << "LyX: Error waiting for child: "
- << strerror(errno) << endl;
+ // Might happen perfectly innocently, eg as a result
+ // of the system (3) call.
+ if (errno)
+ lyxerr << "LyX: Error waiting for child: "
+ << strerror(errno) << endl;
continue;
}