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