(68 . 13)(68 . 14)
349 int total = 0;
350
351 while (total < noctets) {
352 errno = 0;
353 nread = read(from, out+total, noctets-total);
354 //on interrupt received just try again
355 if (nread == -1 && errno == EINTR)
356 continue;
357 //on error condition abort
358 if (nread == -1 || nread == 0) {
359 printf("Error reading from entropy source %s: %s\n", ENTROPY_SOURCE, strerror(errno));
360 if (errno != 0 && (nread == -1 || nread == 0)) {
361 printf("Error reading from entropy source %s after %d read: %s\n", ENTROPY_SOURCE, total, strerror(errno));
362 return total; //total read so far
363 }
364