summaryrefslogtreecommitdiff
path: root/src/bin/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-07-08 16:55:58 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-07-08 17:16:04 +0900
commitee037d358689c23127e5f90ecee685557521041b (patch)
treefb373bd03f904130ce48dea6b2e0ffb1b12f0aaa /src/bin/evas
parent9e459ef9d620532dd45e0cc07a53e7216df48690 (diff)
evas/cserve2: Add infix to shm filenames
Minor change So, we can distinguish between image, font and index shm files.
Diffstat (limited to 'src/bin/evas')
-rw-r--r--src/bin/evas/evas_cserve2.h2
-rw-r--r--src/bin/evas/evas_cserve2_cache.c9
-rw-r--r--src/bin/evas/evas_cserve2_fonts.c2
-rw-r--r--src/bin/evas/evas_cserve2_shm.c7
4 files changed, 11 insertions, 9 deletions
diff --git a/src/bin/evas/evas_cserve2.h b/src/bin/evas/evas_cserve2.h
index db4cecf9d6..cc1a748970 100644
--- a/src/bin/evas/evas_cserve2.h
+++ b/src/bin/evas/evas_cserve2.h
@@ -259,7 +259,7 @@ void cserve2_message_handler(int fd, Fd_Flags flags, void *data);
259 259
260void cserve2_shm_init(); 260void cserve2_shm_init();
261void cserve2_shm_shutdown(); 261void cserve2_shm_shutdown();
262Shm_Handle *cserve2_shm_request(size_t size); 262Shm_Handle *cserve2_shm_request(const char *infix, size_t size);
263void cserve2_shm_unref(Shm_Handle *shm); 263void cserve2_shm_unref(Shm_Handle *shm);
264const char *cserve2_shm_name_get(const Shm_Handle *shm); 264const char *cserve2_shm_name_get(const Shm_Handle *shm);
265off_t cserve2_shm_map_offset_get(const Shm_Handle *shm); 265off_t cserve2_shm_map_offset_get(const Shm_Handle *shm);
diff --git a/src/bin/evas/evas_cserve2_cache.c b/src/bin/evas/evas_cserve2_cache.c
index 92babaf3ee..1da7b957b6 100644
--- a/src/bin/evas/evas_cserve2_cache.c
+++ b/src/bin/evas/evas_cserve2_cache.c
@@ -425,7 +425,7 @@ _load_request_build(Image_Data *i, int *bufsize)
425 Slave_Msg_Image_Load msg; 425 Slave_Msg_Image_Load msg;
426 426
427 // opening shm for this file 427 // opening shm for this file
428 i->shm = cserve2_shm_request(i->file->w * i->file->h * 4); 428 i->shm = cserve2_shm_request("img", i->file->w * i->file->h * 4);
429 if (!i->shm) 429 if (!i->shm)
430 return NULL; 430 return NULL;
431 431
@@ -541,8 +541,9 @@ _scaling_prepare_and_do(Image_Data *orig)
541 541
542 DBG("Original image's shm path %s", cserve2_shm_name_get(orig->shm)); 542 DBG("Original image's shm path %s", cserve2_shm_name_get(orig->shm));
543 543
544 scale_shm = 544 scale_shm = cserve2_shm_request(
545 cserve2_shm_request(orig->opts.scale_load.dst_w * orig->opts.scale_load.dst_h * 4); 545 "img",
546 orig->opts.scale_load.dst_w * orig->opts.scale_load.dst_h * 4);
546 547
547 DBG("Scale image's shm path %s", cserve2_shm_name_get(scale_shm)); 548 DBG("Scale image's shm path %s", cserve2_shm_name_get(scale_shm));
548 549
@@ -2226,7 +2227,7 @@ do_scaling:
2226 if (entry->shm) 2227 if (entry->shm)
2227 cserve2_shm_unref(entry->shm); 2228 cserve2_shm_unref(entry->shm);
2228 2229
2229 entry->shm = cserve2_shm_request(dst_w * dst_h * 4); 2230 entry->shm = cserve2_shm_request("img", dst_w * dst_h * 4);
2230 if (!entry->shm) return -1; 2231 if (!entry->shm) return -1;
2231 2232
2232 if (_scaling_do(entry->shm, entry, original) != 0) 2233 if (_scaling_do(entry->shm, entry, original) != 0)
diff --git a/src/bin/evas/evas_cserve2_fonts.c b/src/bin/evas/evas_cserve2_fonts.c
index 6c6628c431..af8139e3ca 100644
--- a/src/bin/evas/evas_cserve2_fonts.c
+++ b/src/bin/evas/evas_cserve2_fonts.c
@@ -284,7 +284,7 @@ _font_slave_load(const void *cmddata, void *data EINA_UNUSED)
284static Shm_Handle * 284static Shm_Handle *
285_font_slave_memory_alloc(Font_Info *fi) 285_font_slave_memory_alloc(Font_Info *fi)
286{ 286{
287 Shm_Handle *shm = cserve2_shm_request(fi->shmsize); 287 Shm_Handle *shm = cserve2_shm_request("font", fi->shmsize);
288 288
289 return shm; 289 return shm;
290} 290}
diff --git a/src/bin/evas/evas_cserve2_shm.c b/src/bin/evas/evas_cserve2_shm.c
index ffaa88917b..7dcf05dbb6 100644
--- a/src/bin/evas/evas_cserve2_shm.c
+++ b/src/bin/evas/evas_cserve2_shm.c
@@ -52,7 +52,7 @@ cserve2_shm_size_normalize(size_t size)
52} 52}
53 53
54Shm_Handle * 54Shm_Handle *
55cserve2_shm_request(size_t size) 55cserve2_shm_request(const char *infix, size_t size)
56{ 56{
57 Shm_Mapping *map; 57 Shm_Mapping *map;
58 Shm_Handle *shm; 58 Shm_Handle *shm;
@@ -76,7 +76,8 @@ cserve2_shm_request(size_t size)
76 } 76 }
77 77
78 do { 78 do {
79 snprintf(shmname, sizeof(shmname), "/evas-shm-img-%x-%d", (int)getuid(), id++); 79 snprintf(shmname, sizeof(shmname), "/evas-shm-%x-%s-%08x",
80 (int) getuid(), infix, id++);
80 fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); 81 fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
81 if (fd == -1 && errno != EEXIST) 82 if (fd == -1 && errno != EEXIST)
82 { 83 {
@@ -202,7 +203,7 @@ _cserve2_shm_cleanup()
202 const Eina_File_Direct_Info *f_info; 203 const Eina_File_Direct_Info *f_info;
203 char pattern[NAME_MAX]; 204 char pattern[NAME_MAX];
204 205
205 sprintf(pattern, "evas-shm-img-%x-", (int) getuid()); 206 sprintf(pattern, "evas-shm-%x-", (int) getuid());
206 iter = eina_file_direct_ls("/dev/shm"); 207 iter = eina_file_direct_ls("/dev/shm");
207 EINA_ITERATOR_FOREACH(iter, f_info) 208 EINA_ITERATOR_FOREACH(iter, f_info)
208 { 209 {