提交 e1de5dd2 编写于 作者: M Michal Privoznik

virtestmock: Initialize symbols from stat() and its friends

Introduced by ff376c62.

Previously, init_syms() was called from stat() mock and its
friends. This is crucial because checkPath() might call
printFile() which in turn calls real_fopen(). But if stat() or
one of its friends is the first function called then because of
lacking init_syms() call no real_* is initialized.

The other thing is that we really want the recorded action to be
"stat" instead of __FUNCTION__ because there's no good in
recording that it was __xstat64 who touched some file.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 dd5ae5f2
......@@ -190,7 +190,11 @@ int access(const char *path, int mode)
}
#define VIR_MOCK_STAT_HOOK CHECK_PATH(path)
#define VIR_MOCK_STAT_HOOK \
do { \
init_syms(); \
checkPath(path, "stat"); \
} while (0)
#include "virmockstathelpers.c"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册