bitcoind: Daemonize using daemon(3)

Simplified version of #8278. Assumes that every OS that (a) is supported
by Bitcoin Core (b) supports daemonization has the `daemon()` function
in its C library.

- Removes the fallback path for operating systems that support
  daemonization but not `daemon()`. This prevents never-exercised code from
  ending up in the repository (see discussion here:
  https://github.com/bitcoin/bitcoin/pull/8278#issuecomment-242704745).

- Removes the windows-specific path. Windows doesn't support `daemon()`,
  so it don't support daemonization there, automatically.

Original code by Matthew King, adapted by Wladimir van der Laan.
This commit is contained in:
Matthew King
2016-06-28 09:35:41 +03:00
committed by Wladimir J. van der Laan
parent 37871f216e
commit a92bf4af66
3 changed files with 12 additions and 16 deletions

View File

@@ -324,7 +324,7 @@ std::string HelpMessage(HelpMessageMode mode)
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), BITCOIN_CONF_FILENAME));
if (mode == HMM_BITCOIND)
{
#ifndef WIN32
#if HAVE_DECL_DAEMON
strUsage += HelpMessageOpt("-daemon", _("Run in the background as a daemon and accept commands"));
#endif
}