Fixed invalid assertion in error()

This commit is contained in:
goldsimon 2010-03-26 14:44:20 +00:00
parent e4ad203b0b
commit 64763950ca
1 changed files with 8 additions and 5 deletions

View File

@ -1354,7 +1354,7 @@ parse_command(struct command *com, u32_t len)
}
/*-----------------------------------------------------------------------------------*/
static void
error(s8_t err, struct netconn *conn)
shell_error(s8_t err, struct netconn *conn)
{
switch (err) {
case ESYNTAX:
@ -1366,6 +1366,9 @@ error(s8_t err, struct netconn *conn)
case ETOOMANY:
sendstr("## Too many arguments to command given"NEWLINE, conn);
break;
case ECLOSED:
sendstr("## Connection closed"NEWLINE, conn);
break;
default:
LWIP_ASSERT("Unknown error", 0);
break;
@ -1415,14 +1418,14 @@ shell_main(struct netconn *conn)
com.conn = conn;
err = com.exec(&com);
}
if (err != ESUCCESS) {
error(err, conn);
}
if (err == ECLOSED) {
printf("Closed"NEWLINE);
error(err, conn);
shell_error(err, conn);
goto close;
}
if (err != ESUCCESS) {
shell_error(err, conn);
}
} else {
sendstr(NEWLINE NEWLINE
"lwIP simple interactive shell."NEWLINE