[BACK]Return to patch-Key.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / x11 / libXdmcp / patches

File: [cvs.NetBSD.org] / pkgsrc / x11 / libXdmcp / patches / Attic / patch-Key.c (download)

Revision 1.3, Wed Feb 23 03:10:26 2022 UTC (21 months, 2 weeks ago) by gutteridge
Branch: MAIN
Changes since 1.2: +9 -8 lines

libXdmcp: fix builds with Solaris 11.3

There are circumstances where getentropy() exists but arc4random_buf()
does not, as reported to be the case with Solaris 11.3 in PR pkg/54628,
report and analysis by Sad Clouds. sys/random.h only needs to be
included on SunOS, in that case (second patch iteration).

$NetBSD: patch-Key.c,v 1.3 2022/02/23 03:10:26 gutteridge Exp $

Fix builds where getentropy() exists but arc4random_buf() does not, as
reported to be the case with Solaris 11.3 in PR pkg/54628.

--- Key.c.orig	2019-03-16 16:21:22.000000000 +0000
+++ Key.c
@@ -82,6 +82,11 @@ arc4random_buf (void *auth, int len)
     int	    ret;
 
 #if HAVE_GETENTROPY
+
+#ifdef __sun
+#include <sys/random.h>
+#endif
+
     /* weak emulation of arc4random through the getentropy libc call */
     ret = getentropy (auth, len);
     if (ret == 0)