patch-tools_corosync-keygen_c 997 B

1234567891011121314151617181920212223242526
  1. --- corosync-1.3.1.orig/tools/corosync-keygen.c 2011-04-25 04:37:50.000000000 +0200
  2. +++ corosync-1.3.1/tools/corosync-keygen.c 2011-05-26 07:27:22.000000000 +0200
  3. @@ -65,11 +65,11 @@ int main (void) {
  4. }
  5. }
  6. - printf ("Gathering %lu bits for key from /dev/random.\n", (unsigned long)(sizeof (key) * 8));
  7. + printf ("Gathering %lu bits for key from /dev/urandom.\n", (unsigned long)(sizeof (key) * 8));
  8. printf ("Press keys on your keyboard to generate entropy.\n");
  9. - random_fd = open ("/dev/random", O_RDONLY);
  10. + random_fd = open ("/dev/urandom", O_RDONLY);
  11. if (random_fd == -1) {
  12. - perror ("Is /dev/random present? Opening /dev/random");
  13. + perror ("Is /dev/urandom present? Opening /dev/urandom");
  14. exit (errno);
  15. }
  16. @@ -81,7 +81,7 @@ int main (void) {
  17. retry_read:
  18. res = read (random_fd, &key[bytes_read], sizeof (key) - bytes_read);
  19. if (res == -1) {
  20. - perror ("Could not read /dev/random");
  21. + perror ("Could not read /dev/urandom");
  22. exit (errno);
  23. }
  24. bytes_read += res;