nshlib: Fix the build break in nsh_telnetd.c when CONFIG_NSH_CONSOLE=n
set the config: CONFIG_NSH_ROMFSETC=y CONFIG_NSH_CONSOLE=n nsh_telnetd.c: In function 'nsh_telnetstart': nsh_telnetd.c:267:22: error: 'vtbl' undeclared (first use in this function) 267 | nsh_initscript(vtbl); | ^~~~ Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
a5337af484
commit
8721bc6847
@ -463,8 +463,8 @@ FAR struct console_stdio_s *nsh_newconsole(void)
|
||||
|
||||
#ifndef CONFIG_NSH_DISABLEBG
|
||||
pstate->cn_vtbl.clone = nsh_consoleclone;
|
||||
pstate->cn_vtbl.release = nsh_consolerelease;
|
||||
#endif
|
||||
pstate->cn_vtbl.release = nsh_consolerelease;
|
||||
pstate->cn_vtbl.write = nsh_consolewrite;
|
||||
pstate->cn_vtbl.output = nsh_consoleoutput;
|
||||
pstate->cn_vtbl.error = nsh_erroroutput;
|
||||
|
@ -123,8 +123,8 @@ struct nsh_vtbl_s
|
||||
#ifndef CONFIG_NSH_DISABLEBG
|
||||
FAR struct nsh_vtbl_s *(*clone)(FAR struct nsh_vtbl_s *vtbl);
|
||||
void (*addref)(FAR struct nsh_vtbl_s *vtbl);
|
||||
void (*release)(FAR struct nsh_vtbl_s *vtbl);
|
||||
#endif
|
||||
void (*release)(FAR struct nsh_vtbl_s *vtbl);
|
||||
ssize_t (*write)(FAR struct nsh_vtbl_s *vtbl, FAR const void *buffer,
|
||||
size_t nbytes);
|
||||
int (*error)(FAR struct nsh_vtbl_s *vtbl, FAR const char *fmt, ...);
|
||||
|
@ -241,6 +241,9 @@ int nsh_telnetstart(sa_family_t family)
|
||||
|
||||
if (state == TELNETD_NOTRUNNING)
|
||||
{
|
||||
#if defined(CONFIG_NSH_ROMFSETC) && !defined(CONFIG_NSH_CONSOLE)
|
||||
FAR struct console_stdio_s *pstate;
|
||||
#endif
|
||||
struct telnetd_config_s config;
|
||||
|
||||
/* There is a tiny race condition here if two tasks were to try to
|
||||
@ -264,7 +267,9 @@ int nsh_telnetstart(sa_family_t family)
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_NSH_ROMFSETC) && !defined(CONFIG_NSH_CONSOLE)
|
||||
nsh_initscript(vtbl);
|
||||
pstate = nsh_newconsole();
|
||||
nsh_initscript(&pstate->cn_vtbl);
|
||||
nsh_release(&pstate->cn_vtbl);
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_NSH_NETINIT) && !defined(CONFIG_NSH_CONSOLE)
|
||||
|
Loading…
Reference in New Issue
Block a user