Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Sep 1997 19:54:49 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        ache@nagual.pp.ru, bde@zeta.org.au
Cc:        current@FreeBSD.ORG, nnd@itfs.nsk.su
Subject:   Re: PPP - why set CLOCAL for server ('-direct' mode) ?
Message-ID:  <199709110954.TAA04606@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>Bruce, ppp -direct NOT supposed to track carrier because it uses pure
>stdin/stdout as controlling terminal. I can be even file, so TIOCM_CD is
>impossible.  It is upper leve task to track/handle all device specific

It would take a strange input file to work with ppp.  Anyway, in the usual
(isatty(0)) case for -direct, `modem' is
`open(ctermid(NULL), O_RDWR | O_NONBLOCK).  This is essentially the same
as for the usual !-direct case where `modem' is
`open(VarDevice, O_RDWR | O_NONBLOCK).  The main point of opening another
device instance seems to be to avoid closing everything when `modem' is
closed, but this is perfectly broken for the hangup case - setting CLOCAL
prevents normal hangup processing and exiting from ppp may leave stdin open
on a dead modem.  In practice, it shouldn't be that bad.  ppp should restore
the termios state before exiting, and FreeBSD will notice that the connection
has dropped when CLOCAL is turned off.  It isn't clear whether this FreeBSD
beviour is required by POSIX.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199709110954.TAA04606>