diff options
author | brian <brian@FreeBSD.org> | 1997-11-18 00:19:34 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-11-18 00:19:34 +0000 |
commit | cb499269d89363f5b47627aad82a37b8f36ac63a (patch) | |
tree | 8d11e83ce6bce73dbb26bf984481b05216d51362 /usr.sbin/ppp/main.c | |
parent | d692b6bcbf874acd8affe479218c0899ede298db (diff) | |
download | FreeBSD-src-cb499269d89363f5b47627aad82a37b8f36ac63a.zip FreeBSD-src-cb499269d89363f5b47627aad82a37b8f36ac63a.tar.gz |
Add and use a DropClient() function for closing the diagnostic port.
Call DropClient() from Cleanup() too.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r-- | usr.sbin/ppp/main.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c index 5b4c0e6..97b0af1 100644 --- a/usr.sbin/ppp/main.c +++ b/usr.sbin/ppp/main.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: main.c,v 1.100 1997/11/17 00:42:40 brian Exp $ + * $Id: main.c,v 1.101 1997/11/17 01:13:41 brian Exp $ * * TODO: * o Add commands for traffic summary, version display, etc. @@ -180,6 +180,7 @@ TtyOldMode() void Cleanup(int excode) { + DropClient(); ServerClose(); OsInterfaceDown(1); HangupModem(1); @@ -586,7 +587,6 @@ ReadTty() int n; char ch; static int ttystate; - FILE *oVarTerm; char linebuff[LINE_LEN]; LogPrintf(LogDEBUG, "termode = %d, netfd = %d, mode = %d\n", @@ -600,15 +600,8 @@ ReadTty() if (n) DecodeCommand(linebuff, n, IsInteractive(0) ? NULL : "Client"); Prompt(); - } else { - LogPrintf(LogPHASE, "client connection closed.\n"); - oVarTerm = VarTerm; - VarTerm = 0; - if (oVarTerm && oVarTerm != stdout) - fclose(oVarTerm); - close(netfd); - netfd = -1; - } + } else if (n < 0) + DropClient(); return; } |