]> git.ozlabs.org Git - ccan/blobdiff - ccan/failtest/failtest_override.h
failtest: plug memory leak.
[ccan] / ccan / failtest / failtest_override.h
index a97d4e1723654fc5c5efa8e3b15491446a3e1c7e..0d71312c4a63f2820214231ea804988f30cd106f 100644 (file)
@@ -1,6 +1,8 @@
+/* Licensed under LGPL - see LICENSE file for details */
 #ifndef CCAN_FAILTEST_OVERRIDE_H
 #define CCAN_FAILTEST_OVERRIDE_H
 /* This file is included before the source file to test. */
+#include "config.h"
 
 /* Replacement of allocators. */
 #include <stdlib.h>
 #undef fcntl
 #define fcntl(fd, ...) failtest_fcntl((fd), __FILE__, __LINE__, __VA_ARGS__)
 
+/* Replacement of getpid (since failtest will fork). */
+#undef getpid
+#define getpid() failtest_getpid(__FILE__, __LINE__)
+
 #include <ccan/failtest/failtest_proto.h>
 
 #endif /* CCAN_FAILTEST_OVERRIDE_H */