Ecore_Con: make sure to create named pipe with a unique name

Named pipes created with CreateNamedPipe() must have a unique name,
so append the process Id to the name

@fix

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
This commit is contained in:
Vincent Torri 2015-10-08 22:33:30 +02:00 committed by Cedric BAIL
parent 2aa2b63907
commit 1057a45493
1 changed files with 2 additions and 2 deletions

View File

@ -404,13 +404,13 @@ ecore_con_local_listen(Ecore_Con_Server *obj)
}
if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_USER)
snprintf(buf, sizeof(buf), "\\\\.\\pipe\\%s", svr->name);
snprintf(buf, sizeof(buf), "\\\\.\\pipe\\%s%ld", svr->name, GetProcessId(GetCurrentProcess()));
else if ((svr->type & ECORE_CON_TYPE) == ECORE_CON_LOCAL_SYSTEM)
{
const char *computername;
computername = getenv("COMPUTERNAME");
snprintf(buf, sizeof(buf), "\\\\%s\\pipe\\%s", computername, svr->name);
snprintf(buf, sizeof(buf), "\\\\%s\\pipe\\%s%ld", computername, svr->name, GetProcessId(GetCurrentProcess()));
}
svr->path = strdup(buf);