#define AP_UNSIGNEDINT_OFFSET (APR_ALIGN_DEFAULT(sizeof(unsigned int)))
struct ap_slotmem_instance_t {
- char *name; /* per segment name */
- char *pname; /* persisted file name */
+ char *fname; /* file based SHM path/name */
+ char *pname; /* persisted file path/name */
int fbased; /* filebased? */
void *shm; /* ptr to memory segment (apr_shm_t *) */
void *base; /* data set start */
store_slotmem(next);
}
if (next->fbased) {
- apr_shm_remove(next->name, next->gpool);
- apr_file_remove(next->name, next->gpool);
+ apr_shm_remove(next->fname, next->gpool);
+ apr_file_remove(next->fname, next->gpool);
}
apr_shm_destroy((apr_shm_t *)next->shm);
next = next->next;
/* first try to attach to existing slotmem */
if (next) {
for (;;) {
- if (strcmp(next->name, fname) == 0) {
+ if (strcmp(next->fname, fname) == 0) {
/* we already have it */
*new = next;
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02603)
/* For the chained slotmem stuff */
res = (ap_slotmem_instance_t *) apr_pcalloc(gpool,
sizeof(ap_slotmem_instance_t));
- res->name = apr_pstrdup(gpool, fname);
+ res->fname = apr_pstrdup(gpool, fname);
res->pname = apr_pstrdup(gpool, pname);
res->fbased = fbased;
res->shm = shm;
/* first try to attach to existing slotmem */
if (next) {
for (;;) {
- if (strcmp(next->name, fname) == 0) {
+ if (strcmp(next->fname, fname) == 0) {
/* we already have it */
*new = next;
*item_size = next->desc.size;
/* For the chained slotmem stuff */
res = (ap_slotmem_instance_t *) apr_pcalloc(gpool,
sizeof(ap_slotmem_instance_t));
- res->name = apr_pstrdup(gpool, fname);
+ res->fname = apr_pstrdup(gpool, fname);
res->fbased = 1;
res->shm = shm;
res->num_free = (unsigned int *)ptr;
if (i >= slot->desc.num) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02293)
"slotmem(%s) grab failed. Num %u/num_free %u",
- slot->name, slotmem_num_slots(slot),
+ slot->fname, slotmem_num_slots(slot),
slotmem_num_free_slots(slot));
return APR_EINVAL;
}
if (id >= slot->desc.num) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02397)
"slotmem(%s) fgrab failed. Num %u/num_free %u",
- slot->name, slotmem_num_slots(slot),
+ slot->fname, slotmem_num_slots(slot),
slotmem_num_free_slots(slot));
return APR_EINVAL;
}
if (id >= slot->desc.num || !inuse[id] ) {
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf, APLOGNO(02294)
"slotmem(%s) release failed. Num %u/inuse[%u] %d",
- slot->name, slotmem_num_slots(slot),
+ slot->fname, slotmem_num_slots(slot),
id, (int)inuse[id]);
if (id >= slot->desc.num) {
return APR_EINVAL;