aboutsummaryrefslogtreecommitdiffstats
path: root/i2c_helper_linux.c
diff options
context:
space:
mode:
authorAnastasia Klimchuk <aklm@chromium.org>2022-09-02 17:30:00 +1000
committerAnastasia Klimchuk <aklm@chromium.org>2022-09-16 11:19:39 +0000
commit869f3f7b2cf0864e193a198f0423919fedde7765 (patch)
tree52f29701be7a143c1827cf48bd166d6abd0a8249 /i2c_helper_linux.c
parent50ea017af66b38f83ce8ef475cb5cf2eb09275d3 (diff)
downloadflashrom-869f3f7b2cf0864e193a198f0423919fedde7765.tar.gz
flashrom-869f3f7b2cf0864e193a198f0423919fedde7765.tar.bz2
flashrom-869f3f7b2cf0864e193a198f0423919fedde7765.zip
tests: Add workaround to allow tests mock fileno on FreeBSD
fileno can be a function and a macro in FreeBSD, depending on whether the environment in multi-threaded or single-threaded. For single thread, macro is used. Macro is expanded into a inline code which accesses private field of file descriptor. This is impossible to mock in tests. Pretending that environment is multi-threaded makes fileno function to be called instead of a macro. Function can be mocked for tests. BUG=b:237606255 TEST=ninja test tests pass on two environments: 1) FreeBSD 13.1-RELEASE-p2 GENERIC amd64 2) Debian 5.17.11 x86_64 GNU/Linux Change-Id: I3789ea9107a4cf8033cf59bb96d3c82aa58de026 TICKET: https://ticket.coreboot.org/issues/411 Signed-off-by: Anastasia Klimchuk <aklm@chromium.org> Reviewed-on: https://review.coreboot.org/c/flashrom/+/67312 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Thomas Heijligen <src@posteo.de> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Diffstat (limited to 'i2c_helper_linux.c')
0 files changed, 0 insertions, 0 deletions