[PATCH v2 1/3] gen_uuid.c: Ignore return values from fcntl()

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


CID 1049146: Unchecked return value from library in get_clock().
CID 1049147: Unchecked return value from library in get_random_fd().

Closes #4280
---
 cpukit/libmisc/uuid/gen_uuid.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpukit/libmisc/uuid/gen_uuid.c b/cpukit/libmisc/uuid/gen_uuid.c
index 3ca75a0..71b8a56 100644
--- a/cpukit/libmisc/uuid/gen_uuid.c
+++ b/cpukit/libmisc/uuid/gen_uuid.c
@@ -165,6 +165,9 @@ static int get_random_fd(void)
 		if (fd >= 0) {
 			i = fcntl(fd, F_GETFD);
 			if (i >= 0)
+			#ifdef __rtems__
+				(void)
+			#endif
 				fcntl(fd, F_SETFD, i | FD_CLOEXEC);
 		}
 #endif
@@ -426,6 +429,9 @@ try_again:
 		}
 		rewind(state_f);
 		fl.l_type = F_UNLCK;
+	#ifdef __rtems__
+		(void)
+	#endif
 		fcntl(state_fd, F_SETLK, &fl);
 	}
 
-- 
1.8.3.1



More information about the devel mailing list