Skip to content

Commit

Permalink
Fix test on windows
Browse files Browse the repository at this point in the history
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
  • Loading branch information
azeey committed Aug 21, 2024
1 parent a6c47de commit 06d0586
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/SignalHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ int SelfPipe::pipeFd[2];
/// \param[in] _value Signal number.
void onSignalWriteToSelfPipe(int _value)
{
#ifdef _WIN32
// Windows resets the signal handler every time a signal is handled.
std::signal(_value, onSignalWriteToSelfPipe);
#endif
auto valueByte = static_cast<std::uint8_t>(_value);
if (write(SelfPipe::pipeFd[kWriteFd], &valueByte, 1) == -1)
{
Expand Down

0 comments on commit 06d0586

Please sign in to comment.