Add Mutex Guard around open in sendPackage

The `fd` is current thread unsafe and could potentially be
access/overridden by multiple thread. Add the mutex around the open() in
sendPackage to make sure it is only called once.

Tested: Added unit tests to make sure we are thread safe.

Change-Id: I2801bace2c816ed3454c3f79b57609aa8f6ecc33
Signed-off-by: Willy Tu <wltu@google.com>
3 files changed
tree: 331ea2c82094c729e1776f4bbf8bc2b96dd87530
  1. src/
  2. test/
  3. .clang-format
  4. .gitignore
  5. .lcovrc
  6. LICENSE
  7. meson.build
  8. meson.options
  9. OWNERS
  10. README.md
README.md

ipmi-blob-tool

ipmi-blob-tool is a host-side tool that speaks the BLOB protocol over IPMI.

Dependencies

Test cases require google{test,mock}, valgrind, and lcov.

Building

For a standard release build, you want something like:

./bootstrap.sh
./configure --disable-tests
make
make install

For a test / debug build, a typical configuration is

./bootstrap.sh
./configure --enable-tests --enable-coverage --enable-valgrind
make
make check
make check-valgrind
make check-code-coverage