Compare commits

...

2 Commits
trunk ... dev

Author SHA1 Message Date
v-tangmeng 79232d8233 nsh: fix nsh redirect fd double close
avoid double-close of redirection fds

Signed-off-by: zhenwei fang <fangzhenwei@bytedance.com>
2026-04-27 10:36:59 +08:00
v-tangmeng dd7c846d70 apps/system: fix the compile error
error: 'CONFIG_NSH_LINELEN' undeclared (first use in this function);
did you mean 'CONFIG_NSH_PIPELINE'?

Signed-off-by: v-tangmeng <v-tangmeng@xiaomi.com>
2026-04-27 10:33:25 +08:00
5 changed files with 10 additions and 8 deletions

View File

@ -729,6 +729,8 @@ static int nsh_execute(FAR struct nsh_vtbl_s *vtbl,
vtbl->np.np_redir_err)
{
nsh_undirect(vtbl, save);
fd_out = -1;
fd_in = -1;
}
/* Mark errors so that it is possible to test for non-zero return

View File

@ -420,7 +420,7 @@ int main(int argc, FAR char *argv[])
return -ENOMEM;
}
buffer = lib_get_tempbuffer(CONFIG_NSH_LINELEN);
buffer = lib_get_tempbuffer(LINE_MAX);
if (buffer == NULL)
{
nxcamera_release(pcam);
@ -439,7 +439,7 @@ int main(int argc, FAR char *argv[])
/* Read a line from the terminal */
len = readline_stream(buffer, CONFIG_NSH_LINELEN,
len = readline_stream(buffer, LINE_MAX,
stdin, stdout);
if (len > 0)
{

View File

@ -521,7 +521,7 @@ int main(int argc, FAR char *argv[])
return -ENOMEM;
}
buffer = lib_get_tempbuffer(CONFIG_NSH_LINELEN);
buffer = lib_get_tempbuffer(LINE_MAX);
if (buffer == NULL)
{
nxlooper_release(plooper);
@ -541,7 +541,7 @@ int main(int argc, FAR char *argv[])
/* Read a line from the terminal */
len = readline_stream(buffer, CONFIG_NSH_LINELEN,
len = readline_stream(buffer, LINE_MAX,
stdin, stdout);
if (len > 0)
{

View File

@ -810,7 +810,7 @@ int main(int argc, FAR char *argv[])
return -ENOMEM;
}
buffer = lib_get_tempbuffer(CONFIG_NSH_LINELEN);
buffer = lib_get_tempbuffer(LINE_MAX);
if (buffer == NULL)
{
nxplayer_release(pplayer);
@ -830,7 +830,7 @@ int main(int argc, FAR char *argv[])
/* Read a line from the terminal */
len = readline_stream(buffer, CONFIG_NSH_LINELEN,
len = readline_stream(buffer, LINE_MAX,
stdin, stdout);
if (len > 0)
{

View File

@ -550,7 +550,7 @@ int main(int argc, FAR char *argv[])
return -ENOMEM;
}
buffer = lib_get_tempbuffer(CONFIG_NSH_LINELEN);
buffer = lib_get_tempbuffer(LINE_MAX);
if (buffer == NULL)
{
nxrecorder_release(precorder);
@ -570,7 +570,7 @@ int main(int argc, FAR char *argv[])
/* Read a line from the terminal */
len = readline_stream(buffer, CONFIG_NSH_LINELEN,
len = readline_stream(buffer, LINE_MAX,
stdin, stdout);
if (len > 0)
{