X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Ffailtest%2Ffailtest_override.h;h=a97d4e1723654fc5c5efa8e3b15491446a3e1c7e;hp=90d1bfdc48a9f07064e323522b6687d25c24957e;hb=9975a26bad25cdefaefb52705fed76b0baae9ec5;hpb=5e1616698e06e2ce661122c6c9b04aae50271be8;ds=sidebyside diff --git a/ccan/failtest/failtest_override.h b/ccan/failtest/failtest_override.h index 90d1bfdc..a97d4e17 100644 --- a/ccan/failtest/failtest_override.h +++ b/ccan/failtest/failtest_override.h @@ -17,6 +17,10 @@ #define realloc(ptr, size) \ failtest_realloc((ptr), (size), __FILE__, __LINE__) +#undef free +#define free(ptr) \ + failtest_free(ptr) + /* Replacement of I/O. */ #include #include @@ -24,8 +28,8 @@ #include #undef open -#define open(pathname, flags, ...) \ - failtest_open((pathname), (flags), __FILE__, __LINE__, __VA_ARGS__) +#define open(pathname, ...) \ + failtest_open((pathname), __FILE__, __LINE__, __VA_ARGS__) #undef pipe #define pipe(pipefd) \ @@ -39,8 +43,16 @@ #define write(fd, buf, count) \ failtest_write((fd), (buf), (count), __FILE__, __LINE__) +#undef pread +#define pread(fd, buf, count, off) \ + failtest_pread((fd), (buf), (count), (off), __FILE__, __LINE__) + +#undef pwrite +#define pwrite(fd, buf, count, off) \ + failtest_pwrite((fd), (buf), (count), (off), __FILE__, __LINE__) + #undef close -#define close(fd) failtest_close(fd) +#define close(fd) failtest_close(fd, __FILE__, __LINE__) #undef fcntl #define fcntl(fd, ...) failtest_fcntl((fd), __FILE__, __LINE__, __VA_ARGS__)