Ignore:
Timestamp:
Jan 16, 2007, 3:36:33 PM (16 years ago)
Author:
Sam Hocevar
Message:
  • Got rid of the *_load() functions. Now each diverted function is supposed to check that the *_orig() functions it calls are properly loaded.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/load-fd.c

    r1678 r1679  
    7070#endif
    7171static int     (*close_orig)   (int fd);
    72 
    73 
    74 void _zz_load_fd(void)
    75 {
    76     LOADSYM(open);
    77 #ifdef HAVE_OPEN64
    78     LOADSYM(open64);
    79 #endif
    80     LOADSYM(accept);
    81     LOADSYM(socket);
    82     LOADSYM(read);
    83     LOADSYM(readv);
    84     LOADSYM(pread);
    85     LOADSYM(lseek);
    86 #ifdef HAVE_LSEEK64
    87     LOADSYM(lseek64);
    88 #endif
    89     LOADSYM(close);
    90 }
    9172
    9273#define OPEN(fn) \
     
    174155    /* Sanity check, can be OK though (for instance with a character device) */
    175156#ifdef HAVE_LSEEK64
    176     off64_t ret = lseek64_orig(fd, 0, SEEK_CUR);
     157    off64_t ret;
     158    LOADSYM(lseek64);
     159    ret = lseek64_orig(fd, 0, SEEK_CUR);
    177160#else
    178     off_t ret = lseek_orig(fd, 0, SEEK_CUR);
     161    off_t ret;
     162    LOADSYM(lseek);
     163    ret = lseek_orig(fd, 0, SEEK_CUR);
    179164#endif
    180165    if(ret != -1 && ret != _zz_getpos(fd))
     
    308293    int ret;
    309294
    310     LOADSYM(close);
    311 
    312295    /* Hey, it’s our debug channel! Silently pretend we closed it. */
    313296    if(fd == DEBUG_FILENO)
    314297        return 0;
    315298
     299    LOADSYM(close);
    316300    ret = close_orig(fd);
    317301    if(!_zz_ready || !_zz_iswatched(fd) || _zz_disabled)
Note: See TracChangeset for help on using the changeset viewer.