Skip to content

Commit

Permalink
Refs #22352: Fix MacOS build
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL committed Dec 2, 2024
1 parent f36e468 commit cb01b36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/system/tools/fds/CliDiscoveryManagerTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,12 @@ TEST_F(CliDiscoveryManagerTest, GetDomainIdFromCLI)
{
const char* argv[] = {"-d", "4"};
createOptionsAndParser(2, argv);
Option* domain_option = getOption(DOMAIN);
Option* domain_option = getOption((optionIndex)DOMAIN);
DomainId_t domain_id = manager.get_domain_id(domain_option);
EXPECT_EQ(domain_id, 4);
const char* argv2[] = {"-d", "2"};
createOptionsAndParser(2, argv2);
Option* domain_option2 = getOption(DOMAIN);
Option* domain_option2 = getOption((optionIndex)DOMAIN);
DomainId_t domain_id2 = manager.get_domain_id(domain_option2);
EXPECT_EQ(domain_id2, 2);
}
Expand Down Expand Up @@ -438,7 +438,7 @@ TEST_F(CliDiscoveryManagerTest, GetDomainIdFromCLIWithOverwrite)
setTestEnv(domain_env_var, "3");
const char* argv[] = {"-d", "7"};
createOptionsAndParser(2, argv);
Option* domain_option = getOption(DOMAIN);
Option* domain_option = getOption((optionIndex)DOMAIN);
DomainId_t domain_id = manager.get_domain_id(domain_option);
EXPECT_EQ(domain_id, 7);
}
Expand Down
7 changes: 6 additions & 1 deletion tools/fds/CliDiscoveryManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <stdlib.h>
#include <fstream>

#if __APPLE__
#include <signal.h>
#endif

#include <fastdds/dds/domain/DomainParticipantFactory.hpp>
#include <fastdds/dds/log/Log.hpp>
#include <fastdds/rtps/attributes/RTPSParticipantAttributes.hpp>
Expand Down Expand Up @@ -412,7 +416,8 @@ pid_t CliDiscoveryManager::startServerInBackground(
signal(SIGHUP, sigint_handler);
#endif // ifndef _WIN32

chdir("/");
auto res = chdir("/");
(void)res;
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO);
Expand Down

0 comments on commit cb01b36

Please sign in to comment.