mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-02 20:08:17 +00:00
Merged revisions 102323 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r102323 | tilghman | 2008-02-04 15:06:09 -0600 (Mon, 04 Feb 2008) | 7 lines Cross-platform fix: OS X now deprecates the use of the daemon(3) API. (closes issue #11908) Reported by: oej Patches: 20080204__bug11908.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76 ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@102329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -3070,6 +3070,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#if HAVE_WORKING_FORK
|
||||
if (ast_opt_always_fork || !ast_opt_no_fork) {
|
||||
#ifndef HAVE_SBIN_LAUNCHD
|
||||
daemon(1, 0);
|
||||
ast_mainpid = getpid();
|
||||
/* Blindly re-write pid file since we are forking */
|
||||
@@ -3080,6 +3081,9 @@ int main(int argc, char *argv[])
|
||||
fclose(f);
|
||||
} else
|
||||
ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", ast_config_AST_PID, strerror(errno));
|
||||
#else
|
||||
ast_log(LOG_WARNING, "Mac OS X detected. Use '/sbin/launchd -d' to launch with the nofork option.\n");
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user