summaryrefslogtreecommitdiff
path: root/openwrt/package/ser/patches/120-main.patch
blob: eacd0cc23cca5cbedfb1fa2370951f06c3c062b3 (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
--- ser-0.8.14.orig/main.c	2004-06-28 17:41:21.000000000 +0200
+++ ser-0.8.14/main.c	2005-01-07 23:24:27.000000000 +0100
@@ -1447,18 +1447,20 @@
 	/* seed the prng */
 	/* try to use /dev/random if possible */
 	seed=0;
+/* this read call is blocking on OpenWRT, further investigations are necessary
 	if ((rfd=open("/dev/random", O_RDONLY))!=-1){
 try_again:
 		if (read(rfd, (void*)&seed, sizeof(seed))==-1){
-			if (errno==EINTR) goto try_again; /* interrupted by signal */
+			if (errno==EINTR) goto try_again; 
 			LOG(L_WARN, "WARNING: could not read from /dev/random (%d)\n",
 						errno);
 		}
 		DBG("read %u from /dev/random\n", seed);
 			close(rfd);
 	}else{
-		LOG(L_WARN, "WARNING: could not open /dev/random (%d)\n", errno);
-	}
+*/
+		LOG(L_WARN, "WARNING: could not read from /dev/random (%d)\n", errno);
+//	}
 	seed+=getpid()+time(0);
 	DBG("seeding PRNG with %u\n", seed);
 	srand(seed);