From 8a1912b6e722a960723681ee29af035b128caa41 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 27 Apr 2011 13:02:04 +0000
Subject: [PATCH] Utilities: Avoid warnings if unable to open /dev/urandom

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2820 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Utilities.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index c522d1207..7172b8364 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -972,8 +972,8 @@ class SimpleSAML_Utilities {
 		assert('is_int($length)');
 
 		if($fp === NULL) {
-			if (file_exists('/dev/urandom')) {
-				$fp = fopen('/dev/urandom', 'rb');
+			if (@file_exists('/dev/urandom')) {
+				$fp = @fopen('/dev/urandom', 'rb');
 			} else {
 				$fp = FALSE;
 			}
-- 
GitLab