aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-04 21:06:09 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-02-04 21:06:09 +0000
commite706637b7b65408f74f93c11b60f017d32ecbd64 (patch)
tree82bb549e5a3bbfc54a0a95bfca966183f9521d1b /utils
parent40fac56fb744fcccb19f7a2b65cd0f3c03c8cf30 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@102323 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils')
-rw-r--r--utils/muted.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/utils/muted.c b/utils/muted.c
index 37ae42c5e..c406258e1 100644
--- a/utils/muted.c
+++ b/utils/muted.c
@@ -680,8 +680,14 @@ int main(int argc, char *argv[])
fclose(astf);
exit(1);
}
- if (needfork)
+ if (needfork) {
+#ifndef HAVE_SBIN_LAUNCHD
daemon(0,0);
+#else
+ fprintf(stderr, "Mac OS X detected. Use 'launchd -d muted -f' to launch.\n");
+ exit(1);
+#endif
+ }
for(;;) {
if (wait_event()) {
fclose(astf);