I just had to track down a very annoying bug where somebody used popen
to open a pipe but closed the C FILE with fclose
instead of pclose
. On Linux this was no problem, but later this program was compiled on a OSX and things got awry.
So I wonder, what is going wrong when closing a pipe created by popen
with fclose
instead of pclose
? And why was this working on linux, but not OSX/BSD?