blacklist->entries = (zend_blacklist_entry *) calloc(sizeof(zend_blacklist_entry), blacklist->size);
if (!blacklist->entries) {
- zend_accel_error(ACCEL_LOG_FATAL, "Blacklist initialization: no memory\n");
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Blacklist initialization: no memory\n");
return;
}
blacklist->regexp_list = NULL;
static void blacklist_report_regexp_error(const char *pcre_error, int pcre_error_offset)
{
- zend_accel_error(ACCEL_LOG_ERROR, "Blacklist compilation failed (offset: %d), %s\n", pcre_error_offset, pcre_error);
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Blacklist compilation failed (offset: %d), %s\n", pcre_error_offset, pcre_error);
}
static void zend_accel_blacklist_update_regexp(zend_blacklist *blacklist)
if (*c || i == blacklist->pos - 1) {
if (*c) {
if (!backtrack) {
- zend_accel_error(ACCEL_LOG_ERROR, "Too long blacklist entry\n");
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Too long blacklist entry\n");
}
p = backtrack;
} else {
it = (zend_regexp_list*)malloc(sizeof(zend_regexp_list));
if (!it) {
- zend_accel_error(ACCEL_LOG_ERROR, "malloc() failed\n");
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "malloc() failed\n");
return;
}
it->next = NULL;
blacklist->entries[blacklist->pos].path_length = path_length;
blacklist->entries[blacklist->pos].path = (char *)malloc(path_length + 1);
if (!blacklist->entries[blacklist->pos].path) {
- zend_accel_error(ACCEL_LOG_ERROR, "malloc() failed\n");
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "malloc() failed\n");
fclose(fp);
return;
}
/* set up hash pointers table */
accel_hash->hash_table = zend_shared_alloc(sizeof(zend_accel_hash_entry *)*accel_hash->max_num_entries);
if (!accel_hash->hash_table) {
- zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!");
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Insufficient shared memory!");
return;
}
/* set up hash values table */
accel_hash->hash_entries = zend_shared_alloc(sizeof(zend_accel_hash_entry)*accel_hash->max_num_entries);
if (!accel_hash->hash_entries) {
- zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!");
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Insufficient shared memory!");
return;
}
memset(accel_hash->hash_table, 0, sizeof(zend_accel_hash_entry *)*accel_hash->max_num_entries);
fchmod(lock_file, 0666);
if (lock_file == -1) {
- zend_accel_error(ACCEL_LOG_FATAL, "Unable to create lock file: %s (%d)", strerror(errno), errno);
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Unable to create lock file: %s (%d)", strerror(errno), errno);
}
val = fcntl(lock_file, F_GETFD, 0);
val |= FD_CLOEXEC;
static void no_memory_bailout(size_t allocate_size, char *error)
{
- zend_accel_error(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %zu bytes: %s: %s (%d)", allocate_size, error?error:"unknown", strerror(errno), errno );
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Unable to allocate shared memory segment of %zu bytes: %s: %s (%d)", allocate_size, error?error:"unknown", strerror(errno), errno );
}
static void copy_shared_segments(void *to, void *from, int count, int size)
p_tmp_shared_globals = (zend_smm_shared_globals *) zend_shared_alloc(sizeof(zend_smm_shared_globals));
if (!p_tmp_shared_globals) {
- zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!");
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Insufficient shared memory!");
return ALLOC_FAILURE;
}
memset(p_tmp_shared_globals, 0, sizeof(zend_smm_shared_globals));
tmp_shared_segments = zend_shared_alloc(shared_segments_array_size + ZSMMG(shared_segments_count) * sizeof(void *));
if (!tmp_shared_segments) {
- zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!");
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Insufficient shared memory!");
return ALLOC_FAILURE;
}
ZSMMG(shared_memory_state).positions = (int *)zend_shared_alloc(sizeof(int) * ZSMMG(shared_segments_count));
if (!ZSMMG(shared_memory_state).positions) {
- zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!");
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Insufficient shared memory!");
return ALLOC_FAILURE;
}
ZSMMG(reserved) = (char*)ZSMMG(shared_segments)[i]->p + ZSMMG(shared_segments)[i]->end;
ZSMMG(reserved_size) = reserved_size;
} else {
- zend_accel_error(ACCEL_LOG_FATAL, "Insufficient shared memory!");
+ zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Insufficient shared memory!");
return ALLOC_FAILURE;
}
}
#if 1
if (!ZCG(locked)) {
- zend_accel_error(ACCEL_LOG_ERROR, "Shared memory lock not obtained");
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Shared memory lock not obtained");
}
#endif
if (block_size > ZSMMG(shared_free)) { /* No hope to find a big-enough block */
if (errno == EINTR) {
continue;
}
- zend_accel_error(ACCEL_LOG_ERROR, "Cannot create lock - %s (%d)", strerror(errno), errno);
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Cannot create lock - %s (%d)", strerror(errno), errno);
}
break;
}
#ifndef ZEND_WIN32
if (fcntl(lock_file, F_SETLK, &mem_write_unlock) == -1) {
- zend_accel_error(ACCEL_LOG_ERROR, "Cannot remove lock - %s (%d)", strerror(errno), errno);
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Cannot remove lock - %s (%d)", strerror(errno), errno);
}
#ifdef ZTS
tsrm_mutex_unlock(zts_lock);
for (i = 0; i < ZSMMG(shared_segments_count); i++) {
DWORD oldProtect;
if (!VirtualProtect(ZSMMG(shared_segments)[i]->p, ZSMMG(shared_segments)[i]->end, mode, &oldProtect)) {
- zend_accel_error(ACCEL_LOG_ERROR, "Failed to protect memory");
+ zend_accel_error_noreturn(ACCEL_LOG_ERROR, "Failed to protect memory");
}
}
#endif