[PATCH] libosmocore[master]: gsm: Use correct include for getrandom

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Thu Nov 16 15:34:16 UTC 2017


Review at  https://gerrit.osmocom.org/4852

gsm: Use correct include for getrandom

"man getrandom" states sys/random.h is required.

Fixes warning below:
 warning: implicit declaration of function ‘getrandom’; did you mean ‘srandom’? [-Wimplicit-function-declaration]
  rc = getrandom(out, len, GRND_NONBLOCK);
       ^~~~~~~~~

Change-Id: I2e73fd018e887893dc5527d6d73644d627eb963a
---
M src/gsm/gsm_utils.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/4852/1

diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index 8464090..5d8c834 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -100,7 +100,7 @@
 
 /* FIXME: this can be removed once we bump glibc requirements to 2.25: */
 #if defined(__GLIBC__) && (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 25)
-#include <linux/random.h>
+#include <sys/random.h>
 #elif HAVE_DECL_SYS_GETRANDOM
 #include <sys/syscall.h>
 #ifndef GRND_NONBLOCK

-- 
To view, visit https://gerrit.osmocom.org/4852
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e73fd018e887893dc5527d6d73644d627eb963a
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list