File openssl-randfile_fread_interrupt.patch of Package openssl.4105

Index: openssl-1.0.1i/crypto/rand/randfile.c
===================================================================
--- openssl-1.0.1i.orig/crypto/rand/randfile.c	2016-09-23 16:32:24.959499658 +0200
+++ openssl-1.0.1i/crypto/rand/randfile.c	2016-09-23 16:32:25.675510944 +0200
@@ -159,6 +159,11 @@ int RAND_load_file(const char *file, lon
 		else
 			n = BUFSIZE;
 		i=fread(buf,1,n,in);
+		if (i <= 0 && ferror(in) && errno == EINTR) {
+			clearerr(in);
+			continue;
+		}
+
 		if (i <= 0) break;
 #ifdef PURIFY
 		RAND_add(buf,i,(double)i);
openSUSE Build Service is sponsored by