Allow -1 as well as 0 from egd in the error case
diff --git a/OpenSSL/test/test_rand.py b/OpenSSL/test/test_rand.py
index c8645a5..2849f38 100644
--- a/OpenSSL/test/test_rand.py
+++ b/OpenSSL/test/test_rand.py
@@ -108,10 +108,14 @@
 
     def test_egd_missing(self):
         """
-        L{OpenSSL.rand.egd} returns C{0} if the EGD socket passed to it does not
-        exist.
+        L{OpenSSL.rand.egd} returns C{0} or C{-1} if the EGD socket passed
+        to it does not exist.
         """
-        self.assertEquals(rand.egd(self.mktemp()), 0)
+        result = rand.egd(self.mktemp())
+        expected = (-1, 0)
+        self.assertTrue(
+            result in expected,
+            "%r not in %r" % (result, expected))
 
 
     def test_cleanup_wrong_args(self):