Warning if FAKE_EC_NAME is not set.

This commit is contained in:
Florian Pose 2025-03-18 11:33:19 +01:00
parent 91f140e994
commit a460324d94
1 changed files with 10 additions and 1 deletions

View File

@ -437,11 +437,20 @@ ec_master_t *ecrt_request_master(
static const char *getName()
{
static const char *default_name = "FakeEtherCAT";
if (const auto ans = getenv("FAKE_EC_NAME"))
{
return ans;
}
return "FakeEtherCAT";
std::cerr
<< "\nThe environment variable \"FAKE_EC_NAME\" is not set.\n"
<< "Using the default value \"" << default_name << "\".\n"
<< "Please consider to set unique names when using multiple"
<< " instances.\n\n";
return default_name;
}
static int mkpath(const std::string &file_path)