Ignore:
Timestamp:
26/09/2008 21:24:11 (4 years ago)
Author:
chris
Message:

Fix compilation of open64() intercept.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/lib/intercept/intercept.cpp

    r2183 r2299  
    2323 
    2424#include <errno.h> 
     25#include <stdarg.h> 
    2526 
    2627#ifdef HAVE_DLFCN_H 
     
    233234 
    234235extern "C" int 
    235 open(const char *path, int flags, mode_t mode) 
     236#ifdef DEFINE_ONLY_OPEN64 
     237        open64(const char *path, int flags, ...) 
     238#else 
     239        open(const char *path, int flags, ...) 
     240#endif // DEFINE_ONLY_OPEN64 
    236241{ 
    237242        if(intercept_count > 0) 
     
    246251        } 
    247252 
     253        mode_t mode = 0; 
     254        if (flags & O_CREAT) 
     255        { 
     256                va_list ap; 
     257                va_start(ap, flags); 
     258                mode = va_arg(ap, mode_t); 
     259                va_end(ap); 
     260        } 
     261 
    248262#ifdef PLATFORM_NO_SYSCALL 
    249263        int r = TEST_open(path, flags, mode); 
     
    267281} 
    268282 
     283#ifndef DEFINE_ONLY_OPEN64 
    269284extern "C" int 
    270 open64(const char *path, int flags, mode_t mode) 
    271 { 
     285// open64(const char *path, int flags, mode_t mode) 
     286// open64(const char *path, int flags, ...) 
     287open64 (__const char *path, int flags, ...) 
     288{ 
     289        mode_t mode = 0; 
     290        if (flags & O_CREAT) 
     291        { 
     292                va_list ap; 
     293                va_start(ap, flags); 
     294                mode = va_arg(ap, mode_t); 
     295                va_end(ap); 
     296        } 
     297 
    272298        // With _FILE_OFFSET_BITS set to 64 this should really use (flags | 
    273299        // O_LARGEFILE) here, but not actually necessary for the tests and not 
     
    275301        return open(path, flags, mode); 
    276302} 
     303#endif // !DEFINE_ONLY_OPEN64 
    277304 
    278305extern "C" int 
Note: See TracChangeset for help on using the changeset viewer.