diff options
author | Steve Bennett <steveb@workware.net.au> | 2018-11-23 22:13:00 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2018-11-23 22:20:56 +1000 |
commit | a3c72e6f060bc51cd59b486e8d564489856f3de3 (patch) | |
tree | e39c249e827f285236b17613023a71d822262373 | |
parent | e62a1bb88f5749da2e72bd78c6088f09384cb7e3 (diff) | |
download | jimtcl-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>
-rw-r--r-- | jim-aio.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |