From 6728ffe43960c0022cea8fd623136f9569d024d7 Mon Sep 17 00:00:00 2001 From: Pierre Veyre Date: Fri, 30 May 2014 15:34:06 +0200 Subject: [PATCH] Makes file identifier unique in MSG file lib --- src/msg/msg_io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/msg/msg_io.c b/src/msg/msg_io.c index a71770ef7f..a54d6a1b8c 100644 --- a/src/msg/msg_io.c +++ b/src/msg/msg_io.c @@ -195,7 +195,7 @@ msg_file_t MSG_file_open(const char* fullpath, void* data) priv->fullpath = xbt_strdup(fullpath); priv->simdata = xbt_new0(s_simdata_file_t,1); priv->simdata->smx_file = simcall_file_open(fullpath, MSG_host_self()); - sprintf(name, "%s:%s",MSG_host_get_name(MSG_host_self()),fullpath); + sprintf(name, "%s:%i:%s",MSG_host_get_name(MSG_host_self()),MSG_process_self_PID(),fullpath); xbt_lib_set(file_lib, name, MSG_FILE_LEVEL, priv); msg_file_t fd = (msg_file_t) xbt_lib_get_elm_or_null(file_lib, name); __MSG_file_get_info(fd); @@ -213,8 +213,9 @@ int MSG_file_close(msg_file_t fd) { char name[2048]; msg_file_priv_t priv = MSG_file_priv(fd); + int res = simcall_file_close(priv->simdata->smx_file, MSG_host_self()); - sprintf(name, "%s:%s",MSG_host_get_name(MSG_host_self()),priv->fullpath); + sprintf(name, "%s:%i:%s",MSG_host_get_name(MSG_host_self()),MSG_process_self_PID(),priv->fullpath); xbt_lib_unset(file_lib, name, MSG_FILE_LEVEL, 1); return res; } -- 2.20.1