Anastasia Klimchuk has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/58103 )
Change subject: tests: Add wraps for all variants of stat ......................................................................
tests: Add wraps for all variants of stat
stat() can invoke different variants of stat function and all of them needs to be wrapped in tests. For all existing tests it is sufficient for stat to "do nothing, return 0", so all wraps do just that.
Without this patch linux_mtd test fails on a system where __xstat64 is used.
BUG=b:181803212 TEST=running tests on two different environments, with 1) stat64 and 2) __xstat64 invoked
Change-Id: I4c5c243acde09dc5bb6b2a14042fcd23a49707db Signed-off-by: Anastasia Klimchuk aklm@chromium.org --- M tests/meson.build M tests/tests.c 2 files changed, 14 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/03/58103/1
diff --git a/tests/meson.build b/tests/meson.build index 8019bd3..e0f3c68 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -43,6 +43,8 @@ '-Wl,--wrap=fflush', '-Wl,--wrap=stat', '-Wl,--wrap=stat64', + '-Wl,--wrap=__xstat', + '-Wl,--wrap=__xstat64', '-Wl,--wrap=fstat', '-Wl,--wrap=fstat64', '-Wl,--wrap=fileno', diff --git a/tests/tests.c b/tests/tests.c index ac59470..eceb1c5 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -154,6 +154,18 @@ return 0; }
+int __wrap___xstat(const char *path, void *buf) +{ + LOG_ME; + return 0; +} + +int __wrap___xstat64(const char *path, void *buf) +{ + LOG_ME; + return 0; +} + int __wrap_fstat(int fd, void *buf) { LOG_ME;