1 diff -Nru asterisk-1.4.22.org/main/asterisk.c asterisk-1.4.22/main/asterisk.c
2 --- asterisk-1.4.22.org/main/asterisk.c 2008-07-26 17:31:21.000000000 +0200
3 +++ asterisk-1.4.22/main/asterisk.c 2008-12-20 22:49:58.000000000 +0100
6 if (ast_opt_always_fork || !ast_opt_no_fork) {
7 #ifndef HAVE_SBIN_LAUNCHD
12 + workaround for uClibc-0.9.29 mipsel bug:
13 + recursive mutexes do not work if uClibc daemon() function has been called,
14 + if parent thread locks a mutex
15 + the child thread cannot acquire a lock with the same name
16 + (same code works if daemon() is not called)
17 + but duplication of uClibc daemon.c code in here does work.
32 + if ((fd = open("/dev/null", O_RDWR, 0)) != -1) {
33 + dup2(fd, STDIN_FILENO);
34 + dup2(fd, STDOUT_FILENO);
35 + dup2(fd, STDERR_FILENO);
40 ast_mainpid = getpid();
41 /* Blindly re-write pid file since we are forking */
42 unlink(ast_config_AST_PID);