[Asterisk-cvs] asterisk/res res_musiconhold.c,1.39,1.39.2.1
russell at lists.digium.com
russell at lists.digium.com
Wed Nov 17 23:20:05 CST 2004
Update of /usr/cvsroot/asterisk/res
In directory mongoose.digium.com:/tmp/cvs-serv26689/res
Modified Files:
Tag: v1-0
res_musiconhold.c
Log Message:
check to see if FD's are open before closing (bug #2858)
Index: res_musiconhold.c
===================================================================
RCS file: /usr/cvsroot/asterisk/res/res_musiconhold.c,v
retrieving revision 1.39
retrieving revision 1.39.2.1
diff -u -d -r1.39 -r1.39.2.1
--- res_musiconhold.c 7 Sep 2004 01:22:57 -0000 1.39
+++ res_musiconhold.c 18 Nov 2004 04:20:25 -0000 1.39.2.1
@@ -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) {
More information about the svn-commits
mailing list