-/* Figure out our controlling tty, checking in order stderr,
- * stdin, and stdout. If check_pgrp is set, also check that
- * we belong to the foreground process group associated with
- * that tty. The value of shell_terminal is needed in order to call
- * tcsetpgrp(shell_terminal, ...); */
-#if 0
-static void controlling_tty(int check_pgrp)
-{
- pid_t curpgrp;
-
- if ((curpgrp = tcgetpgrp(shell_terminal = 2)) < 0
- && (curpgrp = tcgetpgrp(shell_terminal = 0)) < 0
- && (curpgrp = tcgetpgrp(shell_terminal = 1)) < 0)
- goto shell_terminal_error;
-
- if (check_pgrp && curpgrp != getpgid(0))
- goto shell_terminal_error;
-
- return;
-
-shell_terminal_error:
- shell_terminal = -1;
- return;
-}
-#endif
-