X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FDaemon%2FDaemon.test.cc;h=584761f42ac09b5ffb41960544a051c65fb08c90;hb=2ffca72ed06b10829071cd1b28d9047ff735f929;hp=d9e4a3eddec6fd647cda7e0feddb540df3c41a8c;hpb=55d09e34a5b9a9c7af23cc5ecb0ab79d58757a2d;p=senf.git diff --git a/Utils/Daemon/Daemon.test.cc b/Utils/Daemon/Daemon.test.cc index d9e4a3e..584761f 100644 --- a/Utils/Daemon/Daemon.test.cc +++ b/Utils/Daemon/Daemon.test.cc @@ -73,7 +73,7 @@ namespace { } }; - int myMain(int argc, char ** argv) + int myMain(int argc, char const ** argv) { MyDaemon instance; return instance.start(argc, argv); @@ -94,6 +94,7 @@ namespace { if (pid < 0) throw senf::SystemException("::fork()"); if (pid == 0) { signal(SIGABRT, &backtrace); + signal(SIGCHLD, SIG_IGN); try { ::_exit(myMain(argc, argv)); } catch (std::exception & ex) { @@ -103,6 +104,7 @@ namespace { } ::_exit(125); } + signal(SIGCHLD, SIG_DFL); int status; if (::waitpid(pid, &status, 0) < 0) throw senf::SystemException("::waitpid()"); @@ -122,7 +124,7 @@ BOOST_AUTO_UNIT_TEST(testDaemon) "--console-log=testDaemon.log", "--pid-file=testDaemon.pid" }; - BOOST_CHECK_EQUAL( run(sizeof(args)/sizeof(*args), const_cast(args)), 0 ); + SENF_CHECK_NO_THROW( BOOST_CHECK_EQUAL( run(sizeof(args)/sizeof(*args), const_cast(args)), 0 ) ); BOOST_CHECK( ! boost::filesystem::exists("invalid.log") ); BOOST_CHECK( ! boost::filesystem::exists("invalid.pid") );