aboutsummaryrefslogtreecommitdiff
path: root/jim-aio.c
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2018-11-23 22:13:00 +1000
committerSteve Bennett <steveb@workware.net.au>2018-11-23 22:20:56 +1000
commita3c72e6f060bc51cd59b486e8d564489856f3de3 (patch)
treee39c249e827f285236b17613023a71d822262373 /jim-aio.c
parente62a1bb88f5749da2e72bd78c6088f09384cb7e3 (diff)
downloadjimtcl-a3c72e6f060bc51cd59b486e8d564489856f3de3.zip
jimtcl-a3c72e6f060bc51cd59b486e8d564489856f3de3.tar.gz
jimtcl-a3c72e6f060bc51cd59b486e8d564489856f3de3.tar.bz2
aio: Don't use FD_CLOEXEC with JIM_ANSIC
Bootstrap jimsh sets JIM_ANSIC but FD_CLOEXEC is enabled. This causes FD_CLOEXEC to be set on fd 0 (stdin), thus closing the default fd 0 in the child process during exec. Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-aio.c')
-rw-r--r--jim-aio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/jim-aio.c b/jim-aio.c
index 313108b..589dce6 100644
--- a/jim-aio.c
+++ b/jim-aio.c
@@ -1712,16 +1712,16 @@ static AioFile *JimMakeChannel(Jim_Interp *interp, FILE *fh, int fd, Jim_Obj *fi
af = Jim_Alloc(sizeof(*af));
memset(af, 0, sizeof(*af));
af->fp = fh;
+ af->filename = filename;
+ af->openFlags = openFlags;
#ifndef JIM_ANSIC
af->fd = fileno(fh);
-#endif
- af->filename = filename;
#ifdef FD_CLOEXEC
if ((openFlags & AIO_KEEPOPEN) == 0) {
(void)fcntl(af->fd, F_SETFD, FD_CLOEXEC);
}
#endif
- af->openFlags = openFlags;
+#endif
af->addr_family = family;
af->fops = &stdio_fops;
af->ssl = NULL;