X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FDaemon%2FDaemon.cc;h=93bfba5428a85036f8d02e035121142f84181a03;hb=412024ed31a4ab4eaea7a4165a434f8efebee325;hp=2b09cc03bb6c6194419b7c836f30a39e73c893fa;hpb=ac90835cbb00ca83a51ab9efb23fdcb75518e808;p=senf.git diff --git a/Utils/Daemon/Daemon.cc b/Utils/Daemon/Daemon.cc index 2b09cc0..93bfba5 100644 --- a/Utils/Daemon/Daemon.cc +++ b/Utils/Daemon/Daemon.cc @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -363,6 +364,15 @@ prefix_ void senf::Daemon::fork() ::sigemptyset(&cldsig); LIBC_CALL( ::sigaddset, (&cldsig, SIGCHLD) ); LIBC_CALL( ::sigprocmask, (SIG_BLOCK, &cldsig, &oldsig) ); + + if (! senf::scheduler::empty() ) + std::cerr << + "\n" + "*** WARNING ***\n" + "Scheduler not empty before fork(). THIS MUST NOT HAPPEN.\n" + "The scheduler will be reinitialized by the fork() and lose all registrations.\n" + "*** WARNING ***\n" + "\n"; LIBC_CALL_RV( pid, ::fork, () ); @@ -563,7 +573,7 @@ prefix_ senf::detail::DaemonWatcher::DaemonWatcher(int pid, int coutpipe, int ce : childPid_(pid), coutpipe_(coutpipe), cerrpipe_(cerrpipe), stdout_(stdout), stderr_(stderr), sigChld_(false), cldSignal_ (SIGCHLD, senf::membind(&DaemonWatcher::sigChld, this)), - timer_ ("DaemanWatcher watchdog", senf::membind(&DaemonWatcher::childOk, this)), + timer_ ("senf::detail::DaemonWatcher::childOk", senf::membind(&DaemonWatcher::childOk, this)), coutForwarder_(coutpipe_, boost::bind(&DaemonWatcher::pipeClosed, this, 1)), cerrForwarder_(cerrpipe_, boost::bind(&DaemonWatcher::pipeClosed, this, 2)) { @@ -631,7 +641,7 @@ prefix_ void senf::detail::DaemonWatcher::childOk() prefix_ senf::detail::DaemonWatcher::Forwarder::Forwarder(int src, Callback cb) : src_(src), cb_(cb), - readevent_("DaemanWatcher::Forwarder", senf::membind(&Forwarder::readData, this), + readevent_("senf::detail::DaemonWatcher::Forwarder::readevent", senf::membind(&Forwarder::readData, this), src_, scheduler::FdEvent::EV_READ) {}