Changeset 2566


Ignore:
Timestamp:
Jul 18, 2008, 11:28:18 AM (12 years ago)
Author:
Sam Hocevar
Message:
  • lib-stream.c: only use the srefill trick on OS X. HP-UX is too different.
File:
1 edited

Legend:

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

    r2559 r2566  
    2424#define __EXTENSIONS__
    2525
    26 #if defined HAVE___SREFILL || defined HAVE___FILBUF
    27 #   define HAVE_REFILL_STDIO
     26/* Define if stdio operations use *only* the refill mechanism */
     27#if defined HAVE___SREFILL
     28#   define REFILL_ONLY_STDIO
    2829#endif
    2930
     
    3738#include <stdio.h>
    3839#include <sys/types.h>
    39 #if defined HAVE_REFILL_STDIO && defined HAVE_UNISTD_H
     40#if defined HAVE_UNISTD_H
    4041#   include <unistd.h> /* Needed for __srefill’s lseek() call */
    4142#endif
     
    145146
    146147/* Our function wrappers */
    147 #if defined HAVE_REFILL_STDIO /* Fuzz fp if we have __srefill() */
     148#if defined REFILL_ONLY_STDIO /* Fuzz fp if we have __srefill() */
    148149#   define FOPEN_FUZZ() \
    149150    _zz_fuzz(fd, ret->FILE_PTR, ret->FILE_CNT)
     
    232233#endif
    233234
    234 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     235#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    235236#   define FSEEK_FUZZ(fn2)
    236237#else
     
    344345    debug("%s([%i])", __func__, fd);
    345346
    346 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     347#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    347348#else
    348349    /* FIXME: check what happens when rewind()ing a pipe */
     
    351352}
    352353
    353 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     354#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    354355#   define FREAD_FUZZ() \
    355356    do \
     
    421422#endif
    422423
    423 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     424#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    424425#   define FGETC_FUZZ
    425426#else
     
    499500#endif
    500501
    501 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     502#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    502503#   define FGETS_FUZZ(fn, fn2) \
    503504        _zz_lock(fd); \
     
    583584        fuzz->upos = _zz_getpos(fd) - 1;
    584585        fuzz->uchar = c;
    585 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     586#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    586587#else
    587588        _zz_addpos(fd, -1);
     
    696697{
    697698    char *ret;
    698 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     699#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    699700#else
    700701    struct fuzz *fuzz;
     
    709710        return ORIG(fgetln)(stream, len);
    710711
    711 #if defined HAVE_REFILL_STDIO /* Don't fuzz or seek if we have __srefill() */
     712#if defined REFILL_ONLY_STDIO /* Don't fuzz or seek if we have __srefill() */
    712713    _zz_lock(fd);
    713714    ret = ORIG(fgetln)(stream, len);
Note: See TracChangeset for help on using the changeset viewer.