[PATCH v2 2/3] main_cp.c: Ignore return value from stat()

Ryan Long ryan.long at oarcorp.com
Mon Apr 5 13:29:13 UTC 2021


CID 26051: Unchecked return value from library in main_cp().

Closes #4365
---
 cpukit/libmisc/shell/main_cp.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpukit/libmisc/shell/main_cp.c b/cpukit/libmisc/shell/main_cp.c
index cddbc95..c2ffc10 100644
--- a/cpukit/libmisc/shell/main_cp.c
+++ b/cpukit/libmisc/shell/main_cp.c
@@ -255,8 +255,14 @@ main_cp(rtems_shell_cp_globals* cp_globals, int argc, char *argv[])
 		 */
 		if (r == -1) {
 			if (Rflag && (Lflag || Hflag))
+			#ifdef __rtems__
+				(void)
+			#endif
 				stat(*argv, &tmp_stat);
 			else
+			#ifdef __rtems__
+				(void)
+			#endif
 				lstat(*argv, &tmp_stat);
 
 			if (S_ISDIR(tmp_stat.st_mode) && Rflag)
-- 
1.8.3.1



More information about the devel mailing list