Added angel process

This commit is contained in:
Thulinma 2016-09-15 15:51:40 +02:00
parent bd4c951488
commit ceafaa57e6
5 changed files with 93 additions and 11 deletions

View file

@ -210,7 +210,7 @@ bool Util::Config::parseArgs(int & argc, char ** & argv) {
std::cout << "- Flag: Big metadata. Enabled longer live stream durations. Breaks compatibility with DTSH files generated by versions without this flag." << std::endl;
#endif
std::cout << "Built on " __DATE__ ", " __TIME__ << std::endl;
exit(1);
exit(0);
break;
default:
jsonForEach(vals, it) {

View file

@ -17,17 +17,17 @@ namespace Util {
private:
static bool childRunning(pid_t p);
static tthread::mutex plistMutex;
static tthread::thread * reaper_thread;
static std::set<pid_t> plist; ///< Holds active process list.
static bool handler_set; ///< If true, the sigchld handler has been setup.
static bool thread_handler;///< True while thread handler should be running.
static void childsig_handler(int signum);
static void exit_handler();
static void runCmd(std::string & cmd);
static void setHandler();
static char* const* dequeToArgv(std::deque<std::string> & argDeq);
static void grim_reaper(void * n);
public:
static tthread::thread * reaper_thread;
static bool handler_set; ///< If true, the sigchld handler has been setup.
static void setHandler();
static std::string getOutputOf(char * const * argv);
static std::string getOutputOf(std::deque<std::string> & argDeq);
static pid_t StartPiped(char * const * argv, int * fdin, int * fdout, int * fderr);