[Olsr-dev] Olsrd 0.6.5.2 is freezing at start

Ferry Huberts (spam-protected)
Wed Mar 27 19:07:52 CET 2013


doesn't really matter to me.
this was the fastest, safe way to solve it.
doesn't hurt to keep the /dev/random read around like this IMHO

feel free to remove the /dev/random read if you want :-)

I now have to go into a new talk here @EclipseCon

On 27/03/13 14:03, Henning Rogge wrote:
> Do you think this patch makes sense?
>
> Is there a case where /dev/urandom is not available but /dev/random is?
>
> Henning
>
> On Wed, Mar 27, 2013 at 7:01 PM, Ferry Huberts <(spam-protected)> wrote:
>> I've fixed it on the release branch and cherry-picked it onto master.
>>
>>
>>
>> On 27/03/13 13:51, Henning Rogge wrote:
>>>
>>> Can you apply the following patch to your code and run them again?
>>>
>>>
>>> diff --git a/src/main.c b/src/main.c
>>> index e741457..b9cea5a 100644
>>> --- a/src/main.c
>>> +++ b/src/main.c
>>> @@ -287,10 +287,7 @@ static void initRandom(void) {
>>>    #ifndef _WIN32
>>>      int randomFile;
>>>
>>> -  randomFile = open("/dev/random", O_RDONLY);
>>> -  if (randomFile == -1) {
>>> -    randomFile = open("/dev/urandom", O_RDONLY);
>>> -  }
>>> +  randomFile = open("/dev/urandom", O_RDONLY);
>>>
>>>      if (randomFile != -1) {
>>>        if (read(randomFile, &seed, sizeof(seed)) != sizeof(seed)) {
>>>
>>>
>>>
>>> Henning Rogge
>>>
>>
>> --
>> Ferry Huberts
>
>
>

-- 
Ferry Huberts




More information about the Olsr-dev mailing list