evas/cserve2: Add UID to shm file path
+ Improve debug for corner case (never happened)
This commit is contained in:
parent
82584a85fb
commit
07ef0fdd93
|
@ -258,7 +258,10 @@ _socketfd_setup(void)
|
||||||
{
|
{
|
||||||
if (connect(s, (struct sockaddr *)&socket_local, len) != -1)
|
if (connect(s, (struct sockaddr *)&socket_local, len) != -1)
|
||||||
{
|
{
|
||||||
|
if (errno == EADDRINUSE)
|
||||||
ERR("cserve2 service already there: \"%s\"", strerror(errno));
|
ERR("cserve2 service already there: \"%s\"", strerror(errno));
|
||||||
|
else
|
||||||
|
ERR("cserve2 could connect the socket: %d \"%s\"", errno, strerror(errno));
|
||||||
close(s);
|
close(s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ cserve2_shm_request(size_t size)
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
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);
|
fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
|
||||||
if (fd == -1 && errno != EEXIST)
|
if (fd == -1 && errno != EEXIST)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue