pullup from trunk
authorTom Yu <tlyu@mit.edu>
Thu, 13 Jan 2005 00:37:57 +0000 (00:37 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 13 Jan 2005 00:37:57 +0000 (00:37 +0000)
ticket: 2871
version_fixed: 1.4

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@17021 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/ChangeLog
src/lib/crypto/prng.c

index ddcca3230122c953f8b99c599ca5fd53ba07538f..f77c170b25f47e46bf898218fe3eef1fb701e81a 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-12  Tom Yu  <tlyu@mit.edu>
+
+       * prng.c (read_entropy_from_device): Use ssize_t, not size_t, so
+       read() returning -1 doesn't cause trouble.
+
 2004-11-17  Ken Raeburn  <raeburn@mit.edu>
 
        * prng.c (do_yarrow_init): Move mutex initialization here.
index 7656a23aa8e6489ea1bd3824b423d5d2b7c05901..7371e974e0a791857d29da4dc9eb88b395c4b5cf 100644 (file)
@@ -192,7 +192,7 @@ read_entropy_from_device (krb5_context context, const char *device)
     return 0;
   }
   for (left = sizeof (buf); left > 0;) {
-    size_t count;
+    ssize_t count;
     count = read (fd, &buf, (unsigned) left);
     if (count <= 0) {
       close(fd);