mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
nshlib/nsh_parse: Removing unnecessary value assigning about redirection
Coverity Log CID 1612757: (#1 of 1): UNUSED_VALUE assigned_value: The value -1 is assigned to param.fd_in here, but the stored value is overwritten before it can be used. Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
f1212a6065
commit
39bd365787
1 changed files with 3 additions and 7 deletions
|
|
@ -2739,16 +2739,12 @@ static int nsh_parse_command(FAR struct nsh_vtbl_s *vtbl, FAR char *cmdline)
|
|||
if (param.fd_in != -1)
|
||||
{
|
||||
close(param.fd_in);
|
||||
param.fd_in = -1;
|
||||
vtbl->np.np_redir_in = redirect_in_save;
|
||||
}
|
||||
|
||||
if (param.fd_out != -1)
|
||||
{
|
||||
close(param.fd_out);
|
||||
param.fd_out = -1;
|
||||
vtbl->np.np_redir_out = redirect_out_save;
|
||||
}
|
||||
close(param.fd_out);
|
||||
param.fd_out = -1;
|
||||
vtbl->np.np_redir_out = redirect_out_save;
|
||||
|
||||
redirect_in_save = vtbl->np.np_redir_in;
|
||||
vtbl->np.np_redir_in = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue