Skip to content

Commit

Permalink
refactor: remove namespace alias to make the code more explicit
Browse files Browse the repository at this point in the history
Signed-off-by: Mehmet Emin BAŞOĞLU <[email protected]>
  • Loading branch information
mebasoglu committed Jun 24, 2024
1 parent 75e5945 commit 4a29075
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,19 @@ ComponentMonitor::ResourceUsageReport ComponentMonitor::pid_to_report(const pid_

std::stringstream ComponentMonitor::run_system_command(const std::string & cmd) const

Check warning on line 92 in system/autoware_component_monitor/src/component_monitor_node.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_component_monitor/src/component_monitor_node.cpp#L92

Added line #L92 was not covered by tests
{
namespace bp = boost::process;
int out_fd[2];
if (pipe2(out_fd, O_CLOEXEC) != 0) {
RCLCPP_ERROR_STREAM(get_logger(), "Error setting flags on out_fd");

Check warning on line 96 in system/autoware_component_monitor/src/component_monitor_node.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_component_monitor/src/component_monitor_node.cpp#L96

Added line #L96 was not covered by tests
}
bp::pipe out_pipe{out_fd[0], out_fd[1]};
bp::ipstream is_out{std::move(out_pipe)};
boost::process::pipe out_pipe{out_fd[0], out_fd[1]};
boost::process::ipstream is_out{std::move(out_pipe)};

Check warning on line 99 in system/autoware_component_monitor/src/component_monitor_node.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_component_monitor/src/component_monitor_node.cpp#L98-L99

Added lines #L98 - L99 were not covered by tests

int err_fd[2];
if (pipe2(err_fd, O_CLOEXEC) != 0) {
RCLCPP_ERROR_STREAM(get_logger(), "Error setting flags on err_fd");

Check warning on line 103 in system/autoware_component_monitor/src/component_monitor_node.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_component_monitor/src/component_monitor_node.cpp#L103

Added line #L103 was not covered by tests
}
bp::pipe err_pipe{err_fd[0], err_fd[1]};
bp::ipstream is_err{std::move(err_pipe)};
boost::process::pipe err_pipe{err_fd[0], err_fd[1]};
boost::process::ipstream is_err{std::move(err_pipe)};

Check warning on line 106 in system/autoware_component_monitor/src/component_monitor_node.cpp

View check run for this annotation

Codecov / codecov/patch

system/autoware_component_monitor/src/component_monitor_node.cpp#L105-L106

Added lines #L105 - L106 were not covered by tests

boost::process::child c(
cmd, environment_, boost::process::std_out > is_out, boost::process::std_err > is_err);
Expand Down

0 comments on commit 4a29075

Please sign in to comment.