Subject: Re: Thread safety

Re: Thread safety

From: Eino Tuominen <eino_at_utu.fi>
Date: Thu, 03 Apr 2008 19:19:18 +0300

Daniel Stenberg wrote:
> On Thu, 3 Apr 2008, Eino Tuominen wrote:
>
>> Ok, I have made the modifications and it seems to work correctly now.
>> A patch is attached.
>
> Great, but can you please make it with diff -u?

Of course, I blame the common cold. Attached is a patch with diff -u.

-- 
   Eino Tuominen

? randomize.patch
Index: ares_init.c
===================================================================
RCS file: /cvsroot/curl/curl/ares/ares_init.c,v
retrieving revision 1.68
diff -u -r1.68 ares_init.c
--- ares_init.c 22 Oct 2007 23:31:40 -0000 1.68
+++ ares_init.c 3 Apr 2008 16:17:28 -0000
@@ -1333,13 +1333,9 @@
   }
 #else /* !WIN32 */
 #ifdef RANDOM_FILE
- char buffer[256];
   FILE *f = fopen(RANDOM_FILE, "rb");
   if(f) {
- size_t i;
- size_t rc = fread(buffer, key_data_len, 1, f);
- for(i=0; i<rc && counter < key_data_len; i++)
- key[counter++]=buffer[i];
+ counter = fread(key, 1, key_data_len, f);
     fclose(f);
   }
 #endif
Received on 2008-04-03