[MERGED] 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 16:15:43 UTC 2017


Pau Espin Pedrol has submitted this change and it was merged.

Change subject: gsm: Use correct include for getrandom
......................................................................


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(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



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: merged
Gerrit-Change-Id: I2e73fd018e887893dc5527d6d73644d627eb963a
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>



More information about the gerrit-log mailing list