X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FDaemon%2FDaemon.cc;h=2cba370fd9c18d9f8607233c9b8d380f2818e81f;hb=63b650afb727cce067817ce9451eecb932446bf3;hp=d008c384c060c4cfd1c7b206013e89c7fa0b4fe4;hpb=b41b8147c7a2d40e2f69471e183840be8a0b95da;p=senf.git diff --git a/Utils/Daemon/Daemon.cc b/Utils/Daemon/Daemon.cc index d008c38..2cba370 100644 --- a/Utils/Daemon/Daemon.cc +++ b/Utils/Daemon/Daemon.cc @@ -1,8 +1,8 @@ // $Id$ // // Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer NETwork research (NET) +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -151,15 +151,15 @@ prefix_ void senf::Daemon::detach() namespace { /* Purposely *not* derived from std::exception */ - struct DaemonFailureException { - DaemonFailureException(unsigned c) : code(c) {} + struct DaemonExitException { + DaemonExitException(unsigned c) : code(c) {} unsigned code; }; } -prefix_ void senf::Daemon::fail(unsigned code) +prefix_ void senf::Daemon::exit(unsigned code) { - throw DaemonFailureException(code); + throw DaemonExitException(code); } prefix_ int senf::Daemon::start(int argc, char const ** argv) @@ -182,8 +182,8 @@ prefix_ int senf::Daemon::start(int argc, char const ** argv) main(); } - catch (DaemonFailureException & e) { - return e.code > 0 ? e.code : 1; + catch (DaemonExitException & e) { + return e.code; } #ifdef NDEBUG @@ -223,7 +223,8 @@ prefix_ void senf::Daemon::configure() std::string::size_type komma (arg.find(',')); if (komma == std::string::npos) { boost::trim(arg); - consoleLog(arg); + if (arg == std::string("none")) consoleLog(""); + else if (!arg.empty()) consoleLog(arg); } else { std::string arg1 (arg,0,komma); std::string arg2 (arg,komma+1);