Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Sato <[email protected]>
  • Loading branch information
daisukes committed Jan 17, 2025
1 parent 798f1e7 commit f93cf60
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions power_controller/power_controller_kx/src/power_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ class PowerController : public rclcpp::Node
// Set the socket to non-blocking mode
int flags = fcntl(s, F_GETFL, 0);
if (flags < 0) {
perror("fcntl GETFL failed");
close(s);
return -1;
perror("fcntl GETFL failed");
close(s);
return -1;
}
if (fcntl(s, F_SETFL, flags | O_NONBLOCK) < 0) {
perror("fcntl SETFL failed");
close(s);
return -1;
perror("fcntl SETFL failed");
close(s);
return -1;
}
RCLCPP_INFO(this->get_logger(), "Success open CAN %s (%d)", can_interface_.c_str(), s);
return s;
Expand Down Expand Up @@ -453,7 +453,8 @@ class PowerController : public rclcpp::Node
break;
}
}
void shutdown() {
void shutdown()
{
RCLCPP_INFO(get_logger(), "shutting down");
int ret_code = std::system("sudo systemctl poweroff");
}
Expand Down

0 comments on commit f93cf60

Please sign in to comment.