diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2013-02-13 13:49:00 +0100 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-02-13 17:24:03 +0400 |
commit | fc30dc8a5461c5f1b97faef85d12ecc8aa759723 (patch) | |
tree | da04cd1b241f011929979270e34903ad6ff294e2 /accel-pppd | |
parent | 7e14fe6e37890591e4d6c9a0f36b5ac19571a14e (diff) | |
download | accel-ppp-fc30dc8a5461c5f1b97faef85d12ecc8aa759723.tar.gz accel-ppp-fc30dc8a5461c5f1b97faef85d12ecc8aa759723.zip |
cli: Notify user of failed commands
Handle CLI_CMD_FAILED like other command errors (i.e. return 0 to the
caller and send a generic error message).
This makes the CLI handler to flush its input buffer, so that
processing of the next command will be made correctly. This also makes
the telnet handler to send its prompt message.
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/cli/cli.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/accel-pppd/cli/cli.c b/accel-pppd/cli/cli.c index 202e42dc..8b5f5165 100644 --- a/accel-pppd/cli/cli.c +++ b/accel-pppd/cli/cli.c @@ -14,6 +14,7 @@ #include "memdebug.h" #define MAX_CMD_ITEMS 100 +#define MSG_FAILURE_ERROR "command failed\r\n" #define MSG_SYNTAX_ERROR "syntax error\r\n" #define MSG_INVAL_ERROR "invalid argument\r\n" #define MSG_UNKNOWN_CMD "command unknown\r\n" @@ -299,8 +300,10 @@ out_found: switch (err) { case CLI_CMD_EXIT: cln->disconnect(cln); - case CLI_CMD_FAILED: return -1; + case CLI_CMD_FAILED: + cli_send(cln, MSG_FAILURE_ERROR); + return 0; case CLI_CMD_SYNTAX: cli_send(cln, MSG_SYNTAX_ERROR); return 0; |