summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/physical.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1999-01-10 01:26:30 +0000
committerbrian <brian@FreeBSD.org>1999-01-10 01:26:30 +0000
commit541b200a907df9730d6c52f272bc2eb5385c41fe (patch)
tree05376906d358406080e4668bf48135700a58b1e8 /usr.sbin/ppp/physical.c
parent3905f929a7f97b0ef4744b343438c8aa71eadaf2 (diff)
downloadFreeBSD-src-541b200a907df9730d6c52f272bc2eb5385c41fe.zip
FreeBSD-src-541b200a907df9730d6c52f272bc2eb5385c41fe.tar.gz
Only call isatty() when we open our descriptor, and remember
the answer. If we later get a descriptor exception from select(), we know that it's a tty (isatty() returns 0 after the exception on a tty) and remember to call modem_LogicalClose(). The upshot of it all is that descriptor exceptions dont leave the tty locked any more.
Diffstat (limited to 'usr.sbin/ppp/physical.c')
-rw-r--r--usr.sbin/ppp/physical.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/usr.sbin/ppp/physical.c b/usr.sbin/ppp/physical.c
index 680f487..875c459 100644
--- a/usr.sbin/ppp/physical.c
+++ b/usr.sbin/ppp/physical.c
@@ -16,7 +16,7 @@
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
- * $Id: physical.c,v 1.5 1998/08/07 18:42:50 brian Exp $
+ * $Id: physical.c,v 1.6 1998/08/25 17:48:43 brian Exp $
*
*/
@@ -54,11 +54,6 @@ physical_GetFD(struct physical *phys) {
}
int
-physical_IsATTY(struct physical *phys) {
- return isatty(phys->fd);
-}
-
-int
physical_IsSync(struct physical *phys) {
return phys->cfg.speed == 0;
}
@@ -185,7 +180,7 @@ physical_IsSet(struct descriptor *d, const fd_set *fdset)
void
physical_Login(struct physical *phys, const char *name)
{
- if (phys->type == PHYS_DIRECT && physical_IsATTY(phys)) {
+ if (phys->type == PHYS_DIRECT && phys->isatty) {
if (phys->Utmp)
log_Printf(LogERROR, "Oops, already logged in on %s\n", phys->name.base);
else {
OpenPOWER on IntegriCloud