I have a failing C program, and i've narrowed it down to a fork()
ed child trying to close stdout and stderr, which were closed by its parent process before calling fork()
- i assume those streams were passed on to the child process.
how can i tell if a stream is closed in C before attempting to close it using something like fclose(stdout)