It depends upon what the program is doing.
If you close(2) a file descriptor, then a future open(2) would re-use the same file descriptor. Also, future write(2) (without any open
) would fail with EINVAL
.
Most programs don't bother to check if e.g. printf(3) succeeded (in theory, they should).
If you successfully redirect to /dev/null
write(2) is always successful. Read null(4).
I recommend redirecting to /dev/null
when possible.