Skip to content

Commit

Permalink
nshlib/nsh_parse: Removing unnecessary value assigning about redirection
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
JianyuWang0623 committed Dec 18, 2024
1 parent c9b8bfa commit 2603521
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions nshlib/nsh_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2603521

Please sign in to comment.