Changeset 1154
- Timestamp:
- 2012-10-18T09:49:35+02:00 (8 months ago)
- Location:
- trunk/xcache
- Files:
-
- 2 edited
-
xc_lock.c (modified) (2 diffs)
-
xc_shm_mmap.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/xcache/xc_lock.c
r1027 r1154 88 88 89 89 if (pathname == NULL) { 90 static int i = 0;90 static int instanceId = 0; 91 91 const char default_tmpdir[] = { DEFAULT_SLASH, 't', 'm', 'p', '\0' }; 92 92 const char *tmpdir; … … 101 101 size = strlen(tmpdir) + sizeof("/.xcache.lock") - 1 + 3 * 10 + 100; 102 102 myname = malloc(size); 103 snprintf(myname, size - 1, "%s%c.xcache.%d.%d.%d.lock", tmpdir, DEFAULT_SLASH, (int) getuid(), i ++, rand());103 snprintf(myname, size - 1, "%s%c.xcache.%d.%d.%d.lock", tmpdir, DEFAULT_SLASH, (int) getuid(), (int) getpid(), ++instanceId); 104 104 pathname = myname; 105 105 } -
trunk/xcache/xc_shm_mmap.c
r1135 r1154 151 151 int ro_ok; 152 152 volatile void *romem; 153 char tmpname[sizeof(TMP_PATH) - 1 + 100];153 char tmpname[sizeof(TMP_PATH) - 1 + 4 * 10 + 100] = { 0 }; 154 154 const char *errstr = NULL; 155 155 const char *path = (const char *) arg1; 156 static int instanceId = 0; 156 157 157 158 CHECK(shm = calloc(1, sizeof(xc_shm_t)), "shm OOM"); … … 159 160 160 161 if (path == NULL || !path[0]) { 161 static int inc = 0; 162 snprintf(tmpname, sizeof(tmpname) - 1, "%s.%d.%d.%d.%d", TMP_PATH, (int) getuid(), (int) getpid(), inc ++, rand()); 162 snprintf(tmpname, sizeof(tmpname) - 1, "%s.%d.%d.%d", TMP_PATH, (int) getuid(), (int) getpid(), ++instanceId); 163 163 path = tmpname; 164 164 } 165 165 #ifdef ZEND_WIN32 166 166 else { 167 static int inc2 = 0; 168 snprintf(tmpname, sizeof(tmpname) - 1, "%s.%d.%d.%d.%d", path, (int) getuid(), (int) getpid(), inc2 ++, rand()); 167 snprintf(tmpname, sizeof(tmpname) - 1, "%s.%d.%d.%d", path, (int) getuid(), (int) getpid(), ++instanceId); 169 168 path = tmpname; 170 169 }
Note: See TracChangeset
for help on using the changeset viewer.

