In a recent exchange it was discovered that in unix [exec &] had a bad
interaction with closed stdin/stdout.
Of course this is a fairly unfrequent situation...
But during the analysis, it was shown that the [exec &] code in 8.4.7 did
the following sequence of syscalls:
pipe([0, 1]) = 0
fcntl(0, F_SETFD, FD_CLOEXEC) = 0
fcntl(1, F_SETFD, FD_CLOEXEC) = 0
clone(...) = 639
Question: why isn't there any "close(1)" there, while a quick CVS browse on
SF shows that for ages TclpCreateProcess has contained the following code:
478 /* 479 * Read back from the error pipe to see if the
child started 480 * up OK. The info in the pipe (if any)
consists of a decimal 481 * errno value followed by an error
message. 482 */ 483 484 TclpCloseFile(errPipeOut); 485
errPipeOut = NULL; 486 487 fd = GetFd(errPipeIn); 488
count = read(fd, errSpace, (size_t) (sizeof(errSpace) - 1));
Get latest updates about Open Source Projects, Conferences and News.