- if (adrof("ignoreeof") && gtty(SHIN, &tty)==0 && (tty.sg_flags & RAW) == 0) {
- if (loginsh)
- printf("\nUse \"logout\" to logout.\n");
- else
- printf("\nUse \"exit\" to leave csh.\n");
- reset();
+ if (ioctl(SHIN, TIOCGETP, &tty)==0 && (tty.sg_flags & RAW) == 0) {
+ short ctpgrp;
+
+ if (++sincereal > 25)
+ goto oops;
+ if (tpgrp != -1 &&
+ ioctl(FSHTTY, TIOCGPGRP, &ctpgrp) == 0 &&
+ tpgrp != ctpgrp) {
+ ioctl(FSHTTY, TIOCSPGRP, &tpgrp);
+ killpg(ctpgrp, SIGHUP);
+printf("Reset tty pgrp from %d to %d\n", ctpgrp, tpgrp);
+ goto reread;
+ }
+ if (adrof("ignoreeof")) {
+ if (loginsh)
+ printf("\nUse \"logout\" to logout.\n");
+ else
+ printf("\nUse \"exit\" to leave csh.\n");
+ reset();
+ }
+ if (chkstop == 0)
+ panystop(1);