Skip to content

Commit

Permalink
ci(pre-commit): autofix
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed Jun 29, 2023
1 parent e87cd86 commit a5df1ee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions CARET_trace/src/ros_trace_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,21 @@ thread_local bool trace_filter_is_rcl_publish_recorded;

bool exclusion_event = false;

bool filter_launch_node() {
bool filter_launch_node()
{
pid_t pid = getpid();
FILE *fp;
FILE * fp;
char cmd_str[1024];
char result_str[1024];

sprintf( cmd_str, "ps -ax |grep \"ros2 launch\" | grep %d", pid);
fp = popen( cmd_str, "r" );
if ( fgets( result_str, sizeof(result_str), fp ) == NULL ) {
sprintf(cmd_str, "ps -ax |grep \"ros2 launch\" | grep %d", pid);
fp = popen(cmd_str, "r");
if (fgets(result_str, sizeof(result_str), fp) == NULL) {
pclose(fp);
return false;
}
pclose(fp);
if ( strstr(result_str, "grep") == NULL ) {
if (strstr(result_str, "grep") == NULL) {
return true;
}
return false;
Expand Down

0 comments on commit a5df1ee

Please sign in to comment.