Index: res/res_musiconhold.c =================================================================== RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v retrieving revision 1.39 diff -u -r1.39 res_musiconhold.c --- res/res_musiconhold.c 7 Sep 2004 01:22:57 -0000 1.39 +++ res/res_musiconhold.c 15 Nov 2004 03:00:41 -0000 @@ -224,8 +224,11 @@ /* Stdout goes to pipe */ dup2(fds[1], STDOUT_FILENO); /* Close unused file descriptors */ - for (x=3;x<8192;x++) - close(x); + for (x=3;x<8192;x++) { + if (-1 != fcntl(x, F_GETFL)) { + close(x); + } + } /* Child */ chdir(class->dir); if(class->custom) {