If we are accessing a file inside the build directory we should really
not trap the path. Right now this isn't important because we never do
such accesses. However it will be needed when gcov is integrated because
it dumps files to the same place where the binaries are located.
check_LTLIBRARIES = $(TESTSUITE_OVERRIDE_LIBS)
testsuite_uname_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
+testsuite_path_la_CPPFLAGS = $(AM_CPPFLAGS) \
+ -DABS_TOP_BUILDDIR=\"$(abs_top_builddir)\"
testsuite_path_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS)
#include <sys/stat.h>
#include <sys/types.h>
+#include <shared/util.h>
+
#include "testsuite.h"
static void *nextlib;
static inline bool need_trap(const char *path)
{
- return path != NULL && path[0] == '/';
+ return path != NULL && path[0] == '/'
+ && !strstartswith(path, ABS_TOP_BUILDDIR);
}
static const char *trap_path(const char *path, char buf[PATH_MAX * 2])