1 --- libgcrypt-1.8.0/random/rndlinux.c.orig 2017-06-24 13:34:29.000000000 +0200
2 +++ libgcrypt-1.8.0/random/rndlinux.c 2017-07-29 10:42:28.147643001 +0200
8 #if defined(__linux__) && defined(HAVE_SYSCALL)
9 # include <sys/syscall.h>
12 return with something we will actually use 100ms. */
20 /* If we have a modern Linux kernel and we want to read from the
25 - /* If the system has no limit on the number of file descriptors
26 - and we encounter an fd which is larger than the fd_set size,
27 - we don't use the select at all. The select code is only used
28 - to emit progress messages. A better solution would be to
29 - fall back to poll() if available. */
31 - if (fd < FD_SETSIZE)
37 - tv.tv_usec = delay? 0 : 100000;
39 + fds.events = POLLIN;
41 - rc = select (fd+1, &rfds, NULL, NULL, &tv);
42 + rc = poll(&fds, 1, delay ? (delay*1000) : 100);
43 _gcry_post_syscall ();
50 - log_error ("select() error: %s\n", strerror(errno));
51 + log_error ("poll() error: %s\n", strerror(errno));
53 delay = 1; /* Use 1 second if we encounter an error before
54 we have ever blocked. */