Skip to content

Commit

Permalink
Do not use arc4random_buf() on GNU/kFreeBSD
Browse files Browse the repository at this point in the history
It is not available in the GNU C Library.

Change-Id: I36dc92fca283c126669885b75406c8e57f563ce3
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
mitya57 committed Dec 9, 2018
1 parent d36a4fc commit 8d7542a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/corelib/global/qrandom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

#include <errno.h>

#if !QT_CONFIG(getentropy) && !defined(Q_OS_BSD4) && !defined(Q_OS_WIN)
#if !QT_CONFIG(getentropy) && (!defined(Q_OS_BSD4) || defined(__GLIBC__)) && !defined(Q_OS_WIN)
# include "qdeadlinetimer.h"
# include "qhashfunctions.h"

Expand Down Expand Up @@ -259,7 +259,7 @@ static void fallback_fill(quint32 *, qsizetype) Q_DECL_NOTHROW
// no fallback necessary, getentropy cannot fail under normal circumstances
Q_UNREACHABLE();
}
#elif defined(Q_OS_BSD4)
#elif defined(Q_OS_BSD4) && !defined(__GLIBC__)
static void fallback_update_seed(unsigned) {}
static void fallback_fill(quint32 *ptr, qsizetype left) Q_DECL_NOTHROW
{
Expand Down

0 comments on commit 8d7542a

Please sign in to comment.