read() returning -1 doesn't cause trouble.
ticket: 2871
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17020
dc483132-0cff-0310-8789-
dd5450dbe970
+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.
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);