summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-02-04 21:15:18 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-02-04 21:15:18 +0000
commit1dc86caf303467d2e50493fd48b3b1db4c999c73 (patch)
tree33a06d2f7dd1a19383907720d259ca2e315f3a56 /main
parent668cecbafc0299f3e3fa50f4130546acd7e5898a (diff)
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
Diffstat (limited to 'main')
-rw-r--r--main/asterisk.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c
index ad6a88703..4b899cdd9 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -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