summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-10-08 17:06:33 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:16 +0900
commit660ad6e4a414c42364ab555f6f77354a97d04610 (patch)
tree0b421772d693328b40a08030a19b0ad765bbaadf /src
parent6b6e33e262387380af4507e94a123a352ac6ee1c (diff)
evas/cserve2: Add PID to shm filenames
This will help identify new memory pools in case cserve2 restarts and reloads the same glyphs for instance.
Diffstat (limited to 'src')
-rw-r--r--src/bin/evas/evas_cserve2_shm.c6
-rw-r--r--src/bin/evas/evas_cserve2_shm_debug.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/bin/evas/evas_cserve2_shm.c b/src/bin/evas/evas_cserve2_shm.c
index 2df0bb5e60..2045cdd8ca 100644
--- a/src/bin/evas/evas_cserve2_shm.c
+++ b/src/bin/evas/evas_cserve2_shm.c
@@ -77,8 +77,8 @@ cserve2_shm_request(const char *infix, size_t size)
77 } 77 }
78 78
79 do { 79 do {
80 snprintf(shmname, sizeof(shmname), "/evas-shm-%x-%s-%08x", 80 snprintf(shmname, sizeof(shmname), "/evas-shm-%05d-%05d-%s-%08x",
81 (int) getuid(), infix, ++id); 81 (int) getuid(), (int) getpid(), infix, ++id);
82 fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); 82 fd = shm_open(shmname, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
83 if (fd == -1 && errno != EEXIST) 83 if (fd == -1 && errno != EEXIST)
84 { 84 {
@@ -304,7 +304,7 @@ _cserve2_shm_cleanup()
304 const Eina_File_Direct_Info *f_info; 304 const Eina_File_Direct_Info *f_info;
305 char pattern[NAME_MAX]; 305 char pattern[NAME_MAX];
306 306
307 sprintf(pattern, "evas-shm-%x-", (int) getuid()); 307 sprintf(pattern, "evas-shm-%05d-", (int) getuid());
308 iter = eina_file_direct_ls("/dev/shm"); 308 iter = eina_file_direct_ls("/dev/shm");
309 EINA_ITERATOR_FOREACH(iter, f_info) 309 EINA_ITERATOR_FOREACH(iter, f_info)
310 { 310 {
diff --git a/src/bin/evas/evas_cserve2_shm_debug.c b/src/bin/evas/evas_cserve2_shm_debug.c
index 12ee29dd55..8535af45cd 100644
--- a/src/bin/evas/evas_cserve2_shm_debug.c
+++ b/src/bin/evas/evas_cserve2_shm_debug.c
@@ -179,7 +179,7 @@ _shm_files_list(const char *folder)
179 const Eina_File_Direct_Info *f_info; 179 const Eina_File_Direct_Info *f_info;
180 char pattern[64]; 180 char pattern[64];
181 181
182 sprintf(pattern, "/evas-shm-%x-", (int) getuid()); 182 sprintf(pattern, "/evas-shm-%05d-", (int) getuid());
183 iter = eina_file_direct_ls(folder); 183 iter = eina_file_direct_ls(folder);
184 EINA_ITERATOR_FOREACH(iter, f_info) 184 EINA_ITERATOR_FOREACH(iter, f_info)
185 { 185 {
@@ -191,7 +191,7 @@ _shm_files_list(const char *folder)
191 lst = eina_list_append(lst, strdup(shmname)); 191 lst = eina_list_append(lst, strdup(shmname));
192 } 192 }
193 else 193 else
194 DBG("cserve2 cleanup: ignoring %s", f_info->path); 194 DBG("cserve2 scan: ignoring %s", f_info->path);
195 } 195 }
196 eina_iterator_free(iter); 196 eina_iterator_free(iter);
197 197