I assume that you start with standard output unirectirected. Then you close the original standard output and open it again to send the standard output to a file - perhaps using freopen(). When you finish writing to a file, you want to reconnect standard output to the terminal.
, , , freopen(), /dev/tty. , ; (, cron), /dev/tty .
( ), , , , , .
, dup() . dup() .