[PATCH 1/2] rtems/crt0.c: getentropy() stub did not return a value.

Joel Sherrill joel@rtems.org
Wed Mar 15 17:41:00 GMT 2017


Coverity Scan ID: 175342
---
 newlib/libc/sys/rtems/crt0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/sys/rtems/crt0.c b/newlib/libc/sys/rtems/crt0.c
index 769cde7..0e9d426 100644
--- a/newlib/libc/sys/rtems/crt0.c
+++ b/newlib/libc/sys/rtems/crt0.c
@@ -68,7 +68,7 @@ RTEMS_STUB(void, _Libatomic_Lock_n(void *ptr, __size_t n), { });
 RTEMS_STUB(void, _Libatomic_Unlock_n(void *ptr, __size_t n), { });
 
 /* Stubs for routines for arc4random (from <unistd.h> and <machine/_arc4random.h> */
-RTEMS_STUB(int,  getentropy(void *ptr, __size_t n), { });
+RTEMS_STUB(int,  getentropy(void *ptr, __size_t n), { return -1; });
 RTEMS_STUB(void, _arc4random_getentropy_fail(void), { });
 
 #if defined(__GNUC__)
-- 
1.8.3.1



More information about the Newlib mailing list