Ignore:
Timestamp:
Jan 13, 2010 1:09:45 PM (14 years ago)
Author:
bennylp
Message:

Initial OpenBSD fixes (#994):
pjlib:

  • Autoconf fixes in detecting header availability
  • Undefined sched_get_priority_max() and sched_get_priority_min()
    • protect with #ifdef _POSIX_PRIORITY_SCHEDULING, and
    • return hardcoded (0, 31) if OpenBSD macro is declared
  • Better GUID generation

pjlib-test:

  • Reduce the loop in PJILB activesock test
  • Fixed bug in ioqueue unregistration test which caused assertion error in destroying mutex

pjlib-util-test:

  • Fixed bug in pjlib-util resolver test
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/guid_simple.c

    r2394 r3057  
    6868 
    6969    for (p=str->ptr, end=p+PJ_GUID_STRING_LENGTH; p<end; ) { 
    70         /* Assumes rand() only has 16bit randomness */ 
    71         unsigned short val = pj_rand(); 
    72         *p++ = guid_chars[(val >> 8)   & 63]; 
    73         *p++ = guid_chars[(val & 0xFF) & 63]; 
     70        pj_uint32_t rand_val = pj_rand(); 
     71        pj_uint32_t rand_idx = RAND_MAX; 
     72 
     73        for ( ; rand_idx>0 && p<end; rand_idx>>=8, rand_val>>=8, p++) { 
     74            *p = guid_chars[(rand_val & 0xFF) & 63]; 
     75        } 
    7476    } 
    7577 
Note: See TracChangeset for help on using the changeset viewer.