]> git.ozlabs.org Git - ccan/blob - ccan/failtest/failtest_undo.h
failtest: don't insert spurious failures if open would fail anyway.
[ccan] / ccan / failtest / failtest_undo.h
1 #ifndef CCAN_FAILTEST_RESTORE_H
2 #define CCAN_FAILTEST_RESTORE_H
3 /* This file undoes the effect of failtest_override.h. */
4
5 #undef calloc
6 #define calloc(nmemb, size)     \
7         failtest_calloc((nmemb), (size), NULL, 0)
8
9 #undef malloc
10 #define malloc(size)    \
11         failtest_malloc((size), NULL, 0)
12
13 #undef realloc
14 #define realloc(ptr, size)                                      \
15         failtest_realloc((ptr), (size), NULL, 0)
16
17 #undef open
18 #define open(pathname, ...) \
19         failtest_open((pathname), NULL, 0, __VA_ARGS__)
20
21 #undef pipe
22 #define pipe(pipefd) \
23         failtest_pipe((pipefd), NULL, 0)
24
25 #undef read
26 #define read(fd, buf, count) \
27         failtest_read((fd), (buf), (count), NULL, 0)
28
29 #undef write
30 #define write(fd, buf, count) \
31         failtest_write((fd), (buf), (count), NULL, 0)
32
33 #undef close
34 #define close(fd) failtest_close(fd)
35
36 #undef fcntl
37 #define fcntl(fd, ...) \
38         failtest_fcntl((fd), NULL, 0, __VA_ARGS__)
39
40 #endif /* CCAN_FAILTEST_RESTORE_H */