X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/80b0dab1bd7ba4a54252a45cba41e33991e9f6ff..dd49f9d0ff63334f76e12446cd8076edef85c508:/src/mc/remote/AppSide.cpp diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index 450546c02e..39326a0a22 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -152,7 +152,7 @@ void AppSide::handle_finalize(const s_mc_message_int_t* msg) const if (terminate_asap) ::_Exit(0); } -void AppSide::handle_fork(const s_mc_message_int_t* msg) +void AppSide::handle_fork(const s_mc_message_fork_t* msg) { int status; int pid; @@ -174,11 +174,10 @@ void AppSide::handle_fork(const s_mc_message_int_t* msg) struct sockaddr_un addr = {}; addr.sun_family = AF_UNIX; - snprintf(addr.sun_path, 64, "/tmp/simgrid-mc-%" PRIu64, msg->value); - auto addr_size = offsetof(struct sockaddr_un, sun_path) + strlen(addr.sun_path); + std::copy_n(begin(msg->socket_name), MC_SOCKET_NAME_LEN, addr.sun_path); - xbt_assert(connect(sock, (struct sockaddr*)&addr, addr_size) >= 0, - "Cannot connect to Checker on %s: %s.", addr.sun_path, strerror(errno)); + xbt_assert(connect(sock, (struct sockaddr*)&addr, sizeof addr) >= 0, "Cannot connect to Checker on %c%s: %s.", + (addr.sun_path[0] ? addr.sun_path[0] : '@'), addr.sun_path + 1, strerror(errno)); channel_.reset_socket(sock); @@ -247,7 +246,6 @@ void AppSide::handle_actors_status() const // Serialize each transition to describe what each actor is doing XBT_DEBUG("Deliver ACTOR_TRANSITION_PROBE payload"); for (const auto& actor_status : status) { - const auto& actor = actor_list.at(actor_status.aid); const int max_considered = actor_status.max_considered; @@ -328,8 +326,8 @@ void AppSide::handle_messages() break; case MessageType::FORK: - assert_msg_size("FORK", s_mc_message_int_t); - handle_fork((s_mc_message_int_t*)message_buffer.data()); + assert_msg_size("FORK", s_mc_message_fork_t); + handle_fork((s_mc_message_fork_t*)message_buffer.data()); break; case MessageType::WAIT_CHILD: