Changeset 4260


Ignore:
Timestamp:
01/13/10 00:54:43 (3 years ago)
Author:
sam
Message:

Fix the OpenBSD port. On this platform, weird stuff happens such as
fseek() calling fseeko(). Fortunately, we already have the mechanisms
for those situations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/libzzuf/lib-stream.c

    r4253 r4260  
    331331        LOADSYM(myfseek); \ 
    332332        fd = fileno(stream); \ 
    333         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 
     333        if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) \ 
     334             || _zz_islocked(fd)) \ 
    334335            return ORIG(myfseek)(stream, offset, whence); \ 
    335336        debug_stream("before", stream); \ 
     
    362363        LOADSYM(myfsetpos); \ 
    363364        fd = fileno(stream); \ 
    364         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 
     365        if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) \ 
     366             || _zz_islocked(fd)) \ 
    365367            return ORIG(myfsetpos)(stream, pos); \ 
    366368        debug_stream("before", stream); \ 
     
    394396        LOADSYM(rewind); \ 
    395397        fd = fileno(stream); \ 
    396         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 
     398        if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) \ 
     399             || _zz_islocked(fd)) \ 
    397400            return ORIG(rewind)(stream); \ 
    398401        debug_stream("before", stream); \ 
     
    479482        LOADSYM(myfread); \ 
    480483        fd = fileno(stream); \ 
    481         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 
     484        if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) \ 
     485             || _zz_islocked(fd)) \ 
    482486            return ORIG(myfread)(ptr, size, nmemb, stream); \ 
    483487        debug_stream("before", stream); \ 
     
    544548        LOADSYM(myfgetc); \ 
    545549        fd = fileno(s); \ 
    546         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 
     550        if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) \ 
     551             || _zz_islocked(fd)) \ 
    547552            return ORIG(myfgetc)(arg); \ 
    548553        debug_stream("before", s); \ 
     
    639644        LOADSYM(myfgetc); \ 
    640645        fd = fileno(stream); \ 
    641         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 
     646        if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) \ 
     647             || _zz_islocked(fd)) \ 
    642648            return ORIG(myfgets)(s, size, stream); \ 
    643649        debug_stream("before", stream); \ 
     
    720726    LOADSYM(ungetc); 
    721727    fd = fileno(stream); 
    722     if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) 
     728    if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) 
     729         || _zz_islocked(fd)) 
    723730        return ORIG(ungetc)(c, stream); 
    724731 
     
    776783        LOADSYM(fgetc); \ 
    777784        fd = fileno(stream); \ 
    778         if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) \ 
     785        if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) \ 
     786             || _zz_islocked(fd)) \ 
    779787            return ORIG(getdelim)(lineptr, n, delim, stream); \ 
    780788        debug_stream("before", stream); \ 
     
    884892    LOADSYM(fgetc); 
    885893    fd = fileno(stream); 
    886     if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd)) 
     894    if(!_zz_ready || !_zz_iswatched(fd) || !_zz_isactive(fd) 
     895         || _zz_islocked(fd)) 
    887896        return ORIG(fgetln)(stream, len); 
    888897 
Note: See TracChangeset for help on using the changeset viewer.