Merge pull request #145 from ros2/fix_warning
fix warning about ignored return value
This commit is contained in:
commit
91e78406ce
1 changed files with 9 additions and 1 deletions
|
@ -140,7 +140,15 @@ init(int argc, char * argv[])
|
||||||
const size_t error_length = 1024;
|
const size_t error_length = 1024;
|
||||||
char error_string[error_length];
|
char error_string[error_length];
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
strerror_r(errno, error_string, error_length);
|
auto rc = strerror_r(errno, error_string, error_length);
|
||||||
|
if (rc) {
|
||||||
|
// *INDENT-OFF*
|
||||||
|
throw std::runtime_error(
|
||||||
|
"Failed to set SIGINT signal handler: (" + std::to_string(errno) +
|
||||||
|
") unable to retrieve error string");
|
||||||
|
// *INDENT-ON*
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
strerror_s(error_string, error_length, errno);
|
strerror_s(error_string, error_length, errno);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue