evas/cserve2: Add UID to shm file path

+ Improve debug for corner case (never happened)
This commit is contained in:
Jean-Philippe Andre 2013-06-12 13:45:17 +09:00 committed by Cedric Bail
parent 82584a85fb
commit 07ef0fdd93
2 changed files with 5 additions and 2 deletions

View File

@ -258,7 +258,10 @@ _socketfd_setup(void)
{
if (connect(s, (struct sockaddr *)&socket_local, len) != -1)
{
ERR("cserve2 service already there: \"%s\"", strerror(errno));
if (errno == EADDRINUSE)
ERR("cserve2 service already there: \"%s\"", strerror(errno));
else
ERR("cserve2 could connect the socket: %d \"%s\"", errno, strerror(errno));
close(s);
return -1;
}

View File

@ -68,7 +68,7 @@ cserve2_shm_request(size_t size)
}
do {
snprintf(shmname, sizeof(shmname), "/evas-shm-img-%d", id++);
snprintf(shmname, sizeof(shmname), "/evas-shm-img-%x-%d", (int)getuid(), id++);
fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
if (fd == -1 && errno != EEXIST)
{