From 113d0084d4c44e219a055b358b166c32663863d3 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 24 May 2012 01:58:54 -0300 Subject: [PATCH] testsuite: trap calls to mkdir --- testsuite/path.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/testsuite/path.c b/testsuite/path.c index 60df4a0..204c79f 100644 --- a/testsuite/path.c +++ b/testsuite/path.c @@ -139,6 +139,23 @@ TS_EXPORT int open(const char *path, int flags, ...) return _open(p, flags); } +TS_EXPORT int mkdir(const char *path, mode_t mode) +{ + const char *p; + char buf[PATH_MAX * 2]; + static int (*_mkdir)(const char *path, mode_t mode); + + if (!get_rootpath(__func__)) + return -1; + + _mkdir = get_libc_func("mkdir"); + p = trap_path(path, buf); + if (p == NULL) + return -1; + + return _mkdir(p, mode); +} + TS_EXPORT int stat(const char *path, struct stat *st) { const char *p; -- 2.7.4