Changeset 83

Show
Ignore:
Timestamp:
04/17/04 21:40:56 (9 years ago)
Author:
alexcv
Message:

Work around for uClibc thread/select bug...

Location:
trunk/wifidog
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog/ChangeLog

    r82 r83  
    11# $Header$ 
     2 
     32004-04-17  Alexandre Carmel-Veilleux <acv@acv.ca> 
     4        * Added work around for uClibc bug in auth.c 
    25 
    362004-04-17  Philippe April <papril777@yahoo.com> 
  • trunk/wifidog/src/auth.c

    r72 r83  
    3737cleanup_thread(void *ptr) 
    3838{ 
     39#ifndef __UCLIBC__ 
    3940        pthread_cond_t          cond = PTHREAD_COND_INITIALIZER; 
    4041        pthread_mutex_t         cond_mutex = PTHREAD_MUTEX_INITIALIZER; 
    4142        struct  timespec        timeout; 
    42  
     43#endif 
     44         
    4345        while (1) { 
     46                /* Sleep for config.checkinterval seconds... */ 
     47#ifndef __UCLIBC__ 
     48                /* Normal, thread safe */ 
    4449                timeout.tv_sec = time(NULL) + config.checkinterval; 
    4550                timeout.tv_nsec = 0; 
     
    4752                /* Thread safe "sleep" */ 
    4853                pthread_cond_timedwait(&cond, &cond_mutex, &timeout); 
    49  
     54#else 
     55                /* uClibc appears to have major issues... */ 
     56                /* XXX Not compatible with anything but Linux 2.0 to 2.4 */ 
     57                sleep(config.checkinterval); 
     58#endif 
     59                 
    5060                fw_counter(); 
    5161        }