Skip to content

Commit

Permalink
Do not try to fork in the background
Browse files Browse the repository at this point in the history
There is no much point as we've already forked.

Fixes #10890
  • Loading branch information
jyavenard committed Apr 12, 2013
1 parent 59f3369 commit 47561dc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions mythtv/libs/libmythbase/mythcommandlineparser.cpp
Expand Up @@ -2703,11 +2703,19 @@ int MythCommandLineParser::Daemonize(void)
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
LOG(VB_GENERAL, LOG_WARNING, "Unable to ignore SIGPIPE");

#if CONFIG_DARWIN
if (toBool("daemon"))
{
cerr << "Daemonizing is unavaible in OSX" << ENO_STR << endl;
LOG(VB_GENERAL, LOG_WARNING, "Unable to daemonize");
}
#else
if (toBool("daemon") && (daemon(0, 1) < 0))
{
cerr << "Failed to daemonize: " << ENO_STR << endl;
return GENERIC_EXIT_DAEMONIZING_ERROR;
}
#endif

QString username = toString("username");
if (!username.isEmpty() && !setUser(username))
Expand Down

0 comments on commit 47561dc

Please sign in to comment.