Changeset 21 for trunk/mmap.c
- Timestamp:
- 2006-05-25T04:39:16+02:00 (7 years ago)
- File:
-
- 1 edited
-
trunk/mmap.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/mmap.c
r11 r21 138 138 xc_shm_t *xc_shm_init(const char *path, xc_shmsize_t size, zend_bool readonly_protection) /* {{{ */ 139 139 { 140 #ifdef ZEND_WIN32 141 # define TMP_PATH "XCache" 142 #else 143 # define TMP_PATH "/tmp/XCache" 144 #endif 140 145 xc_shm_t *shm = NULL; 141 146 int fd = -1; 142 147 int ro_ok; 143 148 volatile void *romem; 144 char tmpname[sizeof( "/tmp/xcache") - 1 + 100];149 char tmpname[sizeof(TMP_PATH) - 1 + 100]; 145 150 146 151 CHECK(shm = calloc(1, sizeof(xc_shm_t)), "shm OOM"); … … 149 154 if (path == NULL || !path[0]) { 150 155 static int inc = 0; 151 snprintf(tmpname, sizeof(tmpname) - 1, " /tmp/xcache.%d.%d.%d", (int) getuid(), inc ++, rand());156 snprintf(tmpname, sizeof(tmpname) - 1, "%s.%d.%d.%d", TMP_PATH, (int) getuid(), inc ++, rand()); 152 157 path = tmpname; 153 158 }
Note: See TracChangeset
for help on using the changeset viewer.

