- char *name;
- msg_file_priv_t priv = MSG_file_priv(fd);
- if (priv->data)
- xbt_free(priv->data);
-
- int res = simcall_file_close(priv->simdata->smx_file, MSG_host_self());
- name = bprintf("%s:%s:%d", priv->fullpath, MSG_host_self()->cname(), priv->desc_id);
- MSG_host_release_file_descriptor_id(MSG_host_self(), priv->desc_id);
- xbt_lib_unset(file_lib, name, MSG_FILE_LEVEL, 1);
- xbt_free(name);
+ if (fd->data)
+ xbt_free(fd->data);
+
+ int res = simcall_file_close(fd->simdata->smx_file, MSG_host_self());
+ MSG_host_release_file_descriptor_id(MSG_host_self(), fd->desc_id);
+ __MSG_file_destroy(fd);
+