Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> wrote: > > and it still worked with your test case. This is what I see through > strace on Linux with a stubbed out tee call: For comparison this is with a working tee call: 395566 <... fcntl resumed>) = 10 395565 <... fcntl resumed>) = 10 395566 close(1 <unfinished ...> 395565 close(0 <unfinished ...> 395566 <... close resumed>) = 0 395565 <... close resumed>) = 0 395566 dup2(3, 1 <unfinished ...> 395565 dup2(3, 0 <unfinished ...> 395566 <... dup2 resumed>) = 1 395565 <... dup2 resumed>) = 0 395566 close(3 <unfinished ...> 395565 close(3 <unfinished ...> 395566 <... close resumed>) = 0 395565 <... close resumed>) = 0 395565 ioctl(0, TCGETS <unfinished ...> 395566 write(1, "OK\n", 3 <unfinished ...> 395565 <... ioctl resumed>, 0x7ffef74e9c00) = -1 ENOTTY (Inappropriate ioctl for device) 395565 lseek(0, 0, SEEK_CUR <unfinished ...> 395566 <... write resumed>) = 3 395565 <... lseek resumed>) = -1 ESPIPE (Illegal seek) 395566 dup2(10, 1 <unfinished ...> 395565 pipe2( <unfinished ...> 395566 <... dup2 resumed>) = 1 395565 <... pipe2 resumed>[3, 4], 0) = 0 395566 close(10 <unfinished ...> 395565 fcntl(3, F_DUPFD_CLOEXEC, 10 <unfinished ...> 395566 <... close resumed>) = 0 395565 <... fcntl resumed>) = 11 395565 close(3 <unfinished ...> 395566 exit_group(0 <unfinished ...> 395565 <... close resumed>) = 0 395566 <... exit_group resumed>) = ? 395565 fcntl(4, F_DUPFD_CLOEXEC, 10) = 12 395565 close(4) = 0 395565 tee(0, 12, 8192, 0 <unfinished ...> 395566 +++ exited with 0 +++ 395565 <... tee resumed>) = 3 395565 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=395566, si_uid=1000, si_status=0, si_utime=0, si_stime=0} --- 395565 rt_sigreturn({mask=[]}) = 3 395565 read(11, "OK\n", 3) = 3 395565 wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], WNOHANG, NULL) = 395566 395565 wait4(-1, 0x7ffef74e9cec, WNOHANG, NULL) = -1 ECHILD (No child processes) 395565 read(0, "OK\n", 3) = 3 395565 dup2(10, 0) = 0 395565 close(10) = 0 395565 write(1, "2:OK\n", 5) = 5 395565 exit_group(0) = ? 395565 +++ exited with 0 +++ Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt