MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ttydisc_modem

Function ttydisc_modem

freebsd/kern/tty_ttydisc.c:606–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604}
605
606void
607ttydisc_modem(struct tty *tp, int open)
608{
609
610 tty_assert_locked(tp);
611
612 if (open)
613 cv_broadcast(&tp->t_dcdwait);
614
615 /*
616 * Ignore modem status lines when CLOCAL is turned on, but don't
617 * enter the zombie state when the TTY isn't opened, because
618 * that would cause the TTY to be in zombie state after being
619 * opened.
620 */
621 if (!tty_opened(tp) || CMP_FLAG(c, CLOCAL))
622 return;
623
624 if (open == 0) {
625 /*
626 * Lost carrier.
627 */
628 tp->t_flags |= TF_ZOMBIE;
629
630 tty_signal_sessleader(tp, SIGHUP);
631 tty_flush(tp, FREAD|FWRITE);
632 } else {
633 /*
634 * Carrier is back again.
635 */
636
637 /* XXX: what should we do here? */
638 }
639}
640
641static int
642ttydisc_echo_force(struct tty *tp, char c, int quote)

Callers 1

tty_rel_goneFunction · 0.85

Calls 3

cv_broadcastFunction · 0.85
tty_signal_sessleaderFunction · 0.85
tty_flushFunction · 0.85

Tested by

no test coverage detected