summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--unix/tclUnixNotfy.c8
-rw-r--r--unix/tclUnixPipe.c5
3 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 43a5a64..39e3769 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-12-12 Alexandre Ferrieux <ferrieux@users.sourceforge.net>
+
+ * unix/tclUnixNotfy.c Fix missing CLOEXEC on internal pipes [2417695]
+ * unix/tclUnixPipe.c Fix missing CLOEXEC on [chan pipe] fds.
+
2008-12-12 Donal K. Fellows <dkf@users.sf.net>
* generic/tclZlib.c (Tcl_ZlibDeflate): Add a bit of extra space for
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index eae0ee9..434ae84 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixNotfy.c,v 1.37 2008/10/26 12:45:04 dkf Exp $
+ * RCS: @(#) $Id: tclUnixNotfy.c,v 1.38 2008/12/12 16:07:18 ferrieux Exp $
*/
#include "tclInt.h"
@@ -937,6 +937,12 @@ NotifierThreadProc(
if (TclUnixSetBlockingMode(fds[1], TCL_MODE_NONBLOCKING) < 0) {
Tcl_Panic("NotifierThreadProc: could not make trigger pipe non blocking");
}
+ if (fcntl(receivePipe, F_SETFD, FD_CLOEXEC) < 0) {
+ Tcl_Panic("NotifierThreadProc: could not make receive pipe close-on-exec");
+ }
+ if (fcntl(fds[1], F_SETFD, FD_CLOEXEC) < 0) {
+ Tcl_Panic("NotifierThreadProc: could not make trigger pipe close-on-exec");
+ }
/*
* Install the write end of the pipe into the global variable.
diff --git a/unix/tclUnixPipe.c b/unix/tclUnixPipe.c
index a243889..967d633 100644
--- a/unix/tclUnixPipe.c
+++ b/unix/tclUnixPipe.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixPipe.c,v 1.44 2008/07/21 21:46:47 das Exp $
+ * RCS: @(#) $Id: tclUnixPipe.c,v 1.45 2008/12/12 16:07:18 ferrieux Exp $
*/
#include "tclInt.h"
@@ -798,6 +798,9 @@ Tcl_CreatePipe(
return TCL_ERROR;
}
+ fcntl(fileNums[0], F_SETFD, FD_CLOEXEC);
+ fcntl(fileNums[1], F_SETFD, FD_CLOEXEC);
+
*rchan = Tcl_MakeFileChannel((ClientData) INT2PTR(fileNums[0]),
TCL_READABLE);
Tcl_RegisterChannel(interp, *rchan);