*
* @return The StorageAction corresponding to the opening
*/
- virtual StorageActionPtr open(const char* mount, char* path)=0;
+ virtual StorageActionPtr open(char* mount, char* path)=0;
/**
* @brief Close a file
return action;
}
-StorageActionPtr StorageN11::open(const char* mount, char* path)
+StorageActionPtr StorageN11::open(char* mount, char* path)
{
XBT_DEBUG("\tOpen file '%s'",path);
StorageActionPtr action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, OPEN);
action->p_file = file;
free(path);
+ free(mount);
+
return action;
}
lmm_system_t maxminSystem, double bread, double bwrite, double bconnection,
const char* type_id, char *content_name, char *content_type, sg_size_t size, char *attach);
- StorageActionPtr open(const char* mount, char* path);
+ StorageActionPtr open(char* mount, char* path);
StorageActionPtr close(surf_file_t fd);
StorageActionPtr ls(const char *path);
StorageActionPtr read(surf_file_t fd, sg_size_t size);//FIXME:why we have a useless param ptr ??
if(!strcmp(file_mount_name,mnt.name) && strlen(mnt.name)>pos)
{/* The current mount name is found in the full path and is bigger than the previous*/
pos = strlen(mnt.name);
- mount_name = mnt.name;
+ mount_name = strdup(mnt.name);
st = static_cast<StoragePtr>(mnt.storage);
}
+ free(file_mount_name);
}
if(pos>0)
{ /* Mount point found, deduce path + file name from full path (full path = mount name + path + file name)*/
else
xbt_die("Can't find mount point for '%s' on '%s'", fullpath, getName());
- free(file_mount_name);
return st->open(mount_name, path);
}