Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Make s_local_variable::name a std::string
[simgrid.git] / src / mc / mc_process.cpp
index d59e94d..836cf4b 100644 (file)
@@ -48,6 +48,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_process, mc,
 
 static const char *const FILTERED_LIBS[] = {
   "libstdc++",
+  "libboost_context",
   "libc++",
   "libm",
   "libgcc_s",
@@ -190,7 +191,7 @@ Process::Process(pid_t pid, int sockfd)
   Process* process = this;
 
   process->process_flags = MC_PROCESS_NO_FLAG;
-  process->socket = sockfd;
+  process->socket_ = sockfd;
   process->pid_ = pid;
   if (pid==getpid())
     process->process_flags |= MC_PROCESS_SELF_FLAG;
@@ -239,6 +240,9 @@ Process::~Process()
 {
   Process* process = this;
 
+  if (this->socket_ >= 0 && close(this->socket_) < 0)
+    xbt_die("Could not close communication socket");
+
   process->process_flags = MC_PROCESS_NO_FLAG;
   process->pid_ = 0;
 
@@ -378,7 +382,7 @@ void Process::init_memory_map_info()
     mc_object_info_t info =
       MC_find_object_info(this->memory_map_, pathname, is_executable);
     this->object_infos = (mc_object_info_t*) realloc(this->object_infos,
-      (this->object_infos_size+1) * sizeof(mc_object_info_t*));
+      (this->object_infos_size+1) * sizeof(mc_object_info_t));
     this->object_infos[this->object_infos_size] = info;
     this->object_infos_size++;
     if (is_executable)