| 171 |
goto cleanup; |
goto cleanup; |
| 172 |
} |
} |
| 173 |
|
|
| 174 |
|
// Check section aid location dir |
| 175 |
|
ret = mkdir(VAR_SECTION_AID_LOC_DIR, 0750); |
| 176 |
|
if (ret == -1 && errno != EEXIST) |
| 177 |
|
{ |
| 178 |
|
log_error("mkdir(%s) error (%d)\n", VAR_SECTION_AID_LOC_DIR, errno); |
| 179 |
|
goto cleanup; |
| 180 |
|
} |
| 181 |
|
|
| 182 |
// Initialize data pools |
// Initialize data pools |
| 183 |
if ((fp = fopen(VAR_ARTICLE_BLOCK_SHM, "w")) == NULL) |
if ((fp = fopen(VAR_ARTICLE_BLOCK_SHM, "w")) == NULL) |
| 184 |
{ |
{ |
| 207 |
|
|
| 208 |
if (trie_dict_init(VAR_TRIE_DICT_SHM, TRIE_NODE_PER_POOL) < 0) |
if (trie_dict_init(VAR_TRIE_DICT_SHM, TRIE_NODE_PER_POOL) < 0) |
| 209 |
{ |
{ |
| 210 |
printf("trie_dict_init failed\n"); |
printf("trie_dict_init(%s, %d) error\n", VAR_TRIE_DICT_SHM, TRIE_NODE_PER_POOL); |
| 211 |
goto cleanup; |
goto cleanup; |
| 212 |
} |
} |
| 213 |
if (article_block_init(VAR_ARTICLE_BLOCK_SHM, BBS_article_limit_per_section * BBS_max_section / ARTICLE_PER_BLOCK) < 0) |
if (article_block_init(VAR_ARTICLE_BLOCK_SHM, BBS_article_limit_per_section * BBS_max_section / ARTICLE_PER_BLOCK) < 0) |
| 250 |
{ |
{ |
| 251 |
if (load_file(data_files_load_startup[i]) < 0) |
if (load_file(data_files_load_startup[i]) < 0) |
| 252 |
{ |
{ |
| 253 |
log_error("load_file_mmap(%s) error\n", data_files_load_startup[i]); |
log_error("load_file(%s) error\n", data_files_load_startup[i]); |
| 254 |
} |
} |
| 255 |
} |
} |
| 256 |
|
|
| 257 |
// Load user_list and online_user_list |
// Load user_list and online_user_list |
| 258 |
if (user_list_pool_init() < 0) |
if (user_list_pool_init(VAR_USER_LIST_SHM) < 0) |
| 259 |
{ |
{ |
| 260 |
log_error("user_list_pool_init() error\n"); |
log_error("user_list_pool_init(%s) error\n", VAR_USER_LIST_SHM); |
| 261 |
goto cleanup; |
goto cleanup; |
| 262 |
} |
} |
| 263 |
if (user_list_pool_reload(0) < 0) |
if (user_list_pool_reload(0) < 0) |