git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@786
270642c3-0616-0410-b53a-bc976706d245
return argv_;
}
+namespace {
+
+ struct IsDaemonOpt {
+ bool operator()(std::string const & str) const {
+ return str == "--no-daemon"
+ || boost::starts_with(str, std::string("--pid-file="))
+ || boost::starts_with(str, std::string("--console-log="));
+ }
+ };
+}
+
+prefix_ void senf::Daemon::removeDaemonArgs()
+{
+ char ** last (std::remove_if(argv_+1, argv_+argc_, IsDaemonOpt()));
+ *last = 0;
+ argc_ = last - argv_;
+}
+
prefix_ void senf::Daemon::consoleLog(std::string const & path, StdStream which)
{
switch (which) {
int argc(); ///< Access command line parameter count
char ** argv(); ///< Access command line parameters
+ void removeDaemonArgs(); ///< Remove the daemon arguments from argc()/argv()
static void exit(unsigned code=0); ///< Terminate daemon with failure