main_chmod.c: Fix Unchecked return value from library (CID #1063856)

CID 1063856: Unchecked return value from library in
rtems_shell_main_chmod().

Closes #4281
This commit is contained in:
Ryan Long
2021-03-02 11:34:36 -05:00
committed by Joel Sherrill
parent 597e4f4765
commit 8e34aa3b7b

View File

@@ -34,6 +34,7 @@ static int rtems_shell_main_chmod(
int n; int n;
mode_t mode; mode_t mode;
unsigned long tmp; unsigned long tmp;
int sc;
if (argc < 2) { if (argc < 2) {
fprintf(stderr,"%s: too few arguments\n", argv[0]); fprintf(stderr,"%s: too few arguments\n", argv[0]);
@@ -52,8 +53,10 @@ static int rtems_shell_main_chmod(
/* /*
* Now change the files modes * Now change the files modes
*/ */
for (n=2 ; n < argc ; n++) for (n=2 ; n < argc ; n++) {
chmod(argv[n++], mode); sc = chmod(argv[n++], mode);
_Assert_Unused_variable_unequal(sc, -1);
}
return 0; return 0;
} }