#include "support/bind.h"
#include <cerrno>
+#include <cstring>
+#include <list>
#include <queue>
#include <sstream>
#include <utility>
pid_t pid_;
};
-} // namespace anon
+} // namespace
/////////////////////////////////////////////////////////////////////
if (pid_ == 0)
//we also do this in fork(), too, but maybe someone will try
//to bypass that
- IAmAChild = true;
+ IAmAChild = true;
return retval_;
}
argv.push_back(&*it);
prev = *it;
}
- argv.push_back(0);
+ argv.push_back(nullptr);
// Debug output.
if (lyxerr.debugging(Debug::FILES)) {
pid_t cpid = -1;
- STARTUPINFO startup;
- PROCESS_INFORMATION process;
+ STARTUPINFO startup;
+ PROCESS_INFORMATION process;
memset(&startup, 0, sizeof(STARTUPINFO));
memset(&process, 0, sizeof(PROCESS_INFORMATION));
-
+
startup.cb = sizeof(STARTUPINFO);
if (CreateProcess(0, (LPSTR)line.c_str(), 0, 0, FALSE,
/// A process in the queue
typedef pair<string, ForkedCall::sigPtr> Process;
-/** Add a process to the queue. Processes are forked sequentially
- * only one is running at a time.
- * Connect to the returned signal and you'll be informed when
- * the process has ended.
- */
-ForkedCall::sigPtr add(string const & process);
/// in-progress queue
static queue<Process> callQueue_;
/// flag whether queue is running
-static bool running_ = 0;
+static bool running_ = false;
///
void startCaller();
///
void callback(pid_t, int);
+/** Add a process to the queue. Processes are forked sequentially
+ * only one is running at a time.
+ * Connect to the returned signal and you'll be informed when
+ * the process has ended.
+ */
ForkedCall::sigPtr add(string const & process)
{
ForkedCall::sigPtr ptr;
return running_;
}
-} // namespace ForkedCallsQueue
-
+} // namespace ForkedCallQueue
/////////////////////////////////////////////////////////////////////
forkedCalls.erase(it);
actCall->emitSignal();
- /* start all over: emiting the signal can result
+ /* start all over: emitting the signal can result
* in changing the list (Ab)
*/
it = forkedCalls.begin();