- /* tracked_fds_find() is most likely faster than calling isatty(),
- * therefore check if we are tracking this file descriptor first. */
- if (!tracked_fds_find(fd)) {
- return 0;
- }
-
- /* Never touch anything not going to a terminal - unless we are explicitly
- * asked to do so. */
- if (!force_write_to_non_tty && !isatty(fd)) {
- return 0;
- }
-
- return 1;
-}