Changeset 80 for branches/1.0/mmap.c


Ignore:
Timestamp:
2006-06-16T02:56:58+02:00 (8 years ago)
Author:
moo
Message:

fix #16, messy XCACHE_MAP_FAILED logic, thanks Jan

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/mmap.c

    r61 r80  
    200200        shm->ptr_ro = mmap(NULL, size, PROT_READ, MAP_SHARED, fd, 0); 
    201201#endif 
     202        if (shm->ptr_ro == XCACHE_MAP_FAILED) { 
     203            shm->ptr_ro = NULL; 
     204        } 
    202205        romem = shm->ptr_ro; 
    203206 
    204207        /* {{{ check if ptr_ro works */ 
    205208        do { 
    206             if (shm->ptr_ro == XCACHE_MAP_FAILED || shm->ptr_ro == shm->ptr) { 
     209            if (shm->ptr_ro == NULL || shm->ptr_ro == shm->ptr) { 
    207210                break; 
    208211            } 
     
    224227    } 
    225228    else { 
    226         if (shm->ptr_ro != XCACHE_MAP_FAILED) { 
     229        if (shm->ptr_ro) { 
    227230            munmap(shm->ptr_ro, size); 
    228231        } 
Note: See TracChangeset for help on using the changeset viewer.