Merge pull request #533

7f77b23 posix_daemonizer: only create the main daemon object in the last child (moneromooo-monero)
This commit is contained in:
Riccardo Spagni 2015-12-13 22:17:07 +02:00
commit 3a4db6346b
No known key found for this signature in database
GPG key ID: 55432DF31CCD4FCD

View file

@ -74,9 +74,9 @@ namespace daemonizer
{ {
if (command_line::has_arg(vm, arg_detach)) if (command_line::has_arg(vm, arg_detach))
{ {
auto daemon = executor.create_daemon(vm);
tools::success_msg_writer() << "Forking to background..."; tools::success_msg_writer() << "Forking to background...";
posix::fork(); posix::fork();
auto daemon = executor.create_daemon(vm);
return daemon.run(); return daemon.run();
} }
else else