You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by jo...@apache.org on 2007/07/04 12:01:08 UTC

svn commit: r553146 - /apr/apr/trunk/misc/unix/rand.c

Author: jorton
Date: Wed Jul  4 03:01:04 2007
New Revision: 553146

URL: http://svn.apache.org/viewvc?view=rev&rev=553146
Log:
* misc/unix/rand.c (apr_generate_random_bytes): Handle EINTR from
read().

PR: 39790

Modified:
    apr/apr/trunk/misc/unix/rand.c

Modified: apr/apr/trunk/misc/unix/rand.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/unix/rand.c?view=diff&rev=553146&r1=553145&r2=553146
==============================================================================
--- apr/apr/trunk/misc/unix/rand.c (original)
+++ apr/apr/trunk/misc/unix/rand.c Wed Jul  4 03:01:04 2007
@@ -101,7 +101,10 @@
             if ((fd = open(DEV_RANDOM, O_RDONLY)) == -1)
                 return errno;
         
-        rc = read(fd, buf, length);
+        do {
+            rc = read(fd, buf, length);
+        } while (rc == -1 && errno == EINTR);
+
         if (rc < 0) {
             int errnum = errno;
             close(fd);