I\'m working on a program that is using a pipe and forks and need to change the write end to an output file. But when I open a file the file descriptor is 0 which is usuall
It's because you're comparing it to -1.
-1
outputfd doesn't get the result of open. It gets the result of the check for -1.
outputfd
open