X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FDaemon%2FDaemon.cc;h=201fe37f8cbeed08dc7455ff37dc700b35a703a1;hb=d267cc9325ff49f1ef76aa7ddf6b51ceaafd3026;hp=d008c384c060c4cfd1c7b206013e89c7fa0b4fe4;hpb=b41b8147c7a2d40e2f69471e183840be8a0b95da;p=senf.git diff --git a/Utils/Daemon/Daemon.cc b/Utils/Daemon/Daemon.cc index d008c38..201fe37 100644 --- a/Utils/Daemon/Daemon.cc +++ b/Utils/Daemon/Daemon.cc @@ -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