- utmp_sig_wait();
-# ifndef TCVHUP
- setpgrp();
-# endif
- t = open(line, 2); /* open ttyp */
- if (t < 0)
- fatalperror(net, line);
-# ifdef TCVHUP
- /*
- * Hangup anybody else using this ttyp, then reopen it for
- * ourselves.
- */
- (void) chown(line, 0, 0);
- (void) chmod(line, 0600);
- (void) signal(SIGHUP, SIG_IGN);
- (void) ioctl(t, TCVHUP, (char *)0);
- (void) signal(SIGHUP, SIG_DFL);
- setpgrp();
- i = open(line, 2);
- if (i < 0)
- fatalperror(net, line);
- (void) close(t);
- t = i;
-# endif /* TCVHUP */
- /*
- * set ttyp modes as we like them to be
- */
- init_termbuf();
- termbuf.c_oflag = OPOST|ONLCR|TAB3;
- termbuf.c_iflag = IGNPAR|ISTRIP|ICRNL|IXON;
- termbuf.c_lflag = ISIG|ICANON|ECHO|ECHOE|ECHOK;
- termbuf.c_cflag = EXTB|HUPCL|CS8;
- set_termbuf();