X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6a6935148284f51d20bceed365ed0edea8b5a70e..8406356fb85d1428cf121fbb99c45277af246fad:/src/msg/msg_io.cpp diff --git a/src/msg/msg_io.cpp b/src/msg/msg_io.cpp index 7aa6b09209..a37a312db1 100644 --- a/src/msg/msg_io.cpp +++ b/src/msg/msg_io.cpp @@ -204,6 +204,7 @@ msg_error_t MSG_file_unlink(msg_file_t fd) msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId); msg_host_t attached_host = storage_src->host(); fd->unlink(attached_host); + delete fd; return MSG_OK; } @@ -295,7 +296,7 @@ msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpa } } - if (longest_prefix_length > 0) { + if (storage_dest != nullptr) { /* Mount point found, retrieve the host the storage is attached to */ dst_host = storage_dest->host(); }else{ @@ -472,10 +473,12 @@ void *MSG_storage_get_data(msg_storage_t storage) xbt_dict_t MSG_storage_get_content(msg_storage_t storage) { std::map* content = storage->content(); - xbt_dict_t content_dict = xbt_dict_new_homogeneous(nullptr); + xbt_dict_t content_dict = xbt_dict_new_homogeneous(&free); for (auto entry : *content) { - xbt_dict_set(content_dict, entry.first.c_str(), (void*)entry.second, nullptr); + sg_size_t* psize = static_cast(malloc(sizeof(sg_size_t))); + *psize = entry.second; + xbt_dict_set(content_dict, entry.first.c_str(), psize, nullptr); } return content_dict; }