summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/main.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-11-04 01:17:05 +0000
committerbrian <brian@FreeBSD.org>1997-11-04 01:17:05 +0000
commitbd52968d26311964fedc5301c206df302f372273 (patch)
treef001d2d5c1ea74b74efa5b0b9686fae06243301a /usr.sbin/ppp/main.c
parent9e1a11429b69867cc575ecf805ef1c0c4ae8ba42 (diff)
downloadFreeBSD-src-bd52968d26311964fedc5301c206df302f372273.zip
FreeBSD-src-bd52968d26311964fedc5301c206df302f372273.tar.gz
Introduce [local] to "set log [local] ...". This spits
logging out to the screen in terminal mode - should be good for installation problem diagnosis.
Diffstat (limited to 'usr.sbin/ppp/main.c')
-rw-r--r--usr.sbin/ppp/main.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.sbin/ppp/main.c b/usr.sbin/ppp/main.c
index aeb4640..64a7a7d 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.85 1997/10/26 01:03:14 brian Exp $
+ * $Id: main.c,v 1.86 1997/10/29 01:19:42 brian Exp $
*
* TODO:
* o Add commands for traffic summary, version display, etc.
@@ -552,9 +552,16 @@ ReadTty()
n = read(netfd, linebuff, sizeof(linebuff) - 1);
if (n > 0) {
aft_cmd = 1;
- linebuff[n] = '\0';
- LogPrintf(LogCOMMAND, "Client: %s\n", linebuff);
- DecodeCommand(linebuff, n, 1);
+ if (linebuff[n-1] == '\n')
+ linebuff[--n] = '\0';
+ if (n) {
+ if (IsInteractive(0))
+ LogPrintf(LogCOMMAND, "%s\n", linebuff);
+ else
+ LogPrintf(LogCOMMAND, "Client: %s\n", linebuff);
+ DecodeCommand(linebuff, n, 1);
+ } else
+ Prompt();
} else {
LogPrintf(LogPHASE, "client connection closed.\n");
VarLocalAuth = LOCAL_NO_AUTH;
@@ -921,7 +928,7 @@ DoLoop()
VarTerm = fdopen(netfd, "a+");
mode |= MODE_INTER;
Greetings();
- (void) IsInteractive();
+ IsInteractive(1);
Prompt();
}
if ((mode & MODE_INTER) && (netfd >= 0 && FD_ISSET(netfd, &rfds)) &&
OpenPOWER on IntegriCloud