Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync libcontroller master #1018

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion webots_ros2_driver/webots/src/controller/c/robot.c
Original file line number Diff line number Diff line change
Expand Up @@ -1264,9 +1264,15 @@ static char *compute_socket_filename(char *error_buffer) {
return NULL;
}
closedir(dr);
size_t path_length = strlen(webots_instance_folder) + 9;
// check if Webots is currently loading
char *loading_file_path = malloc(strlen(webots_instance_folder) + 9); // webots_instance_folder + '/loading'
snprintf(loading_file_path, strlen(webots_instance_folder) + 9, "%s/loading", webots_instance_folder);
int written = snprintf(loading_file_path, path_length, "%s/loading", webots_instance_folder);
if (written < 0 || (size_t)written >= path_length) {
fprintf(stderr, "Error: Constructing loading_file_path failed or truncated.\n");
free(loading_file_path);
exit(EXIT_FAILURE);
}
FILE *loading_file = fopen(loading_file_path, "r");
if (loading_file) {
fclose(loading_file);
Expand Down