aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-06-03 10:31:00 +1000
committerSteve Bennett <steveb@workware.net.au>2011-06-03 10:31:00 +1000
commit7eea351705b0de2e3aa241f721fde1839be9ffe6 (patch)
tree9589bcebacd5728c16adc8408c687340ebfd47e4
parent8f1c3339a680dd2ca8319a0643711151f0c85698 (diff)
downloadjimtcl-7eea351705b0de2e3aa241f721fde1839be9ffe6.zip
jimtcl-7eea351705b0de2e3aa241f721fde1839be9ffe6.tar.gz
jimtcl-7eea351705b0de2e3aa241f721fde1839be9ffe6.tar.bz2
Don't set FD_CLOEXEC on standard channels
stdio, stdout, stderr Signed-off-by: Steve Bennett <steveb@workware.net.au>
-rw-r--r--jim-aio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/jim-aio.c b/jim-aio.c
index a8580e7..751b3d1 100644
--- a/jim-aio.c
+++ b/jim-aio.c
@@ -959,7 +959,9 @@ static int JimAioOpenCommand(Jim_Interp *interp, int argc,
af = Jim_Alloc(sizeof(*af));
af->fp = fp;
af->fd = fileno(fp);
- fcntl(af->fd, F_SETFD, FD_CLOEXEC);
+ if ((OpenFlags & AIO_KEEPOPEN) == 0) {
+ fcntl(af->fd, F_SETFD, FD_CLOEXEC);
+ }
#ifdef O_NDELAY
af->flags = fcntl(af->fd, F_GETFL);
#endif