[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Why does login_tty(int fd) close fd at the end?



  Isn't closing fd at the end makes all the work meaningless?

    $ man login_tty| grep -A6 'The  login_tty() '
           The  login_tty()  function  prepares for a login on the tty fd
           (which may be a real tty device, or the slave of a  pseudoter-
           minal  as  returned  by  openpty()) by creating a new session,
           making fd the controlling terminal for  the  calling  process,
           setting fd to be the standard input, output, and error streams
           of the current process, and closing fd.



Reply to: