Guard the _GNU_SOURCE #define. It is hard to control what flags consumers may try to build us with. Account for someone adding _GNU_SOURCE to the build line. Change-Id: I4c931da70a9dccc89382ce9100c228c29d28d4bf Reviewed-on: https://boringssl-review.googlesource.com/13621 Commit-Queue: David Benjamin <davidben@google.com> Commit-Queue: Adam Langley <agl@google.com> Reviewed-by: Adam Langley <agl@google.com> CQ-Verified: CQ bot account: commit-bot@chromium.org <commit-bot@chromium.org> (cherry picked from commit e025f3050761b0f737a3f7b53e6a56b07f7bcb9a)
diff --git a/crypto/rand/urandom.c b/crypto/rand/urandom.c index 2572625..f0f31f2 100644 --- a/crypto/rand/urandom.c +++ b/crypto/rand/urandom.c
@@ -12,7 +12,9 @@ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#if !defined(_GNU_SOURCE) #define _GNU_SOURCE /* needed for syscall() on Linux. */ +#endif #include <openssl/rand.h>