about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2017-08-03 22:35:48 +0000
committerAurelien Jarno <aurelien@aurel32.net>2017-08-04 00:41:42 +0200
commita4e5aa1a443cfad09bc98f9bb527995371a53a88 (patch)
treec64ca5e04d4e2b33356ee9ca123bc4ff7fdc1ba0
parent665ce88d68fd13c5c4cbaf2808434c618745137c (diff)
downloadglibc-a4e5aa1a443cfad09bc98f9bb527995371a53a88.tar.gz
glibc-a4e5aa1a443cfad09bc98f9bb527995371a53a88.tar.xz
glibc-a4e5aa1a443cfad09bc98f9bb527995371a53a88.zip
Fix the return type of the getentropy stub
The return type of the getentropy stub is wrongly defined as ssize_t,
while both the <sys/random.h> header and the Linux implementation
define it as int. This patch fixes that.

Changelog:
	* stdlib/getentropy.c (getentropy): Change return type to int.
(cherry picked from commit 2b34e2716f1e84b2c3457ffc868c3dc775b55845)
-rw-r--r--ChangeLog4
-rw-r--r--stdlib/getentropy.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3478699b10..4357ad1eb8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-08-03  Aurelien Jarno  <aurelien@aurel32.net>
 
+	* stdlib/getentropy.c (getentropy): Change return type to int.
+
+2017-08-03  Aurelien Jarno  <aurelien@aurel32.net>
+
 	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated.
 
 2017-08-03  Florian Weimer  <fweimer@redhat.com>
diff --git a/stdlib/getentropy.c b/stdlib/getentropy.c
index a71d4cd8f5..a88bbf8de3 100644
--- a/stdlib/getentropy.c
+++ b/stdlib/getentropy.c
@@ -21,7 +21,7 @@
 
 /* Write LENGTH bytes of randomness starting at BUFFER.  Return 0 on
    success and -1 on failure.  */
-ssize_t
+int
 getentropy (void *buffer, size_t length)
 {
   __set_errno (ENOSYS);