Anastasia Klimchuk submitted this change.

View Change


Approvals: build bot (Jenkins): Verified Thomas Heijligen: Verified; Looks good to me, approved Peter Marheine: Looks good to me, but someone else must approve
tests: Add wrap for __fstat50 to fix tests for NetBSD

Tested by running unit tests on
NetBSD 9.2
Ubuntu 22.04.1 (still pass)

Change-Id: Icb8e453328cb40ab9d628f01ecdc3886a233dad5
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/73649
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Tested-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
---
M tests/meson.build
M tests/tests.c
M tests/wraps.h
3 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/tests/meson.build b/tests/meson.build
index 2de4ee8..df866d7 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -60,6 +60,7 @@
'-Wl,--wrap=__xstat64',
'-Wl,--wrap=fstat',
'-Wl,--wrap=fstat64',
+ '-Wl,--wrap=__fstat50',
'-Wl,--wrap=__fxstat',
'-Wl,--wrap=__fxstat64',
'-Wl,--wrap=fileno',
diff --git a/tests/tests.c b/tests/tests.c
index 911cf47..d296a98 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -229,6 +229,12 @@
return 0;
}

+int __wrap___fstat50(int fd, void *buf)
+{
+ LOG_ME;
+ return 0;
+}
+
int __wrap___fxstat(int fd, void *buf)
{
LOG_ME;
diff --git a/tests/wraps.h b/tests/wraps.h
index 6cc9567..089d992 100644
--- a/tests/wraps.h
+++ b/tests/wraps.h
@@ -46,6 +46,7 @@
int __wrap___xstat64(const char *path, void *buf);
int __wrap_fstat(int fd, void *buf);
int __wrap_fstat64(int fd, void *buf);
+int __wrap___fstat50(int fd, void *buf);
int __wrap___fxstat(int fd, void *buf);
int __wrap___fxstat64(int fd, void *buf);
char *__wrap_fgets(char *buf, int len, FILE *fp);

To view, visit change 73649. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Icb8e453328cb40ab9d628f01ecdc3886a233dad5
Gerrit-Change-Number: 73649
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Alexander Goncharov <chat@joursoir.net>
Gerrit-Reviewer: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Peter Marheine <pmarheine@chromium.org>
Gerrit-Reviewer: Thomas Heijligen <src@posteo.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-MessageType: merged