| 134 |
break; |
break; |
| 135 |
} |
} |
| 136 |
|
|
| 137 |
strncpy(p_section->sname, row[0], sizeof(p_section->sname) - 1); |
strncpy(p_section->sname, row[1], sizeof(p_section->sname) - 1); |
| 138 |
p_section->sname[sizeof(p_section->sname) - 1] = '\0'; |
p_section->sname[sizeof(p_section->sname) - 1] = '\0'; |
| 139 |
strncpy(p_section->stitle, row[1], sizeof(p_section->stitle) - 1); |
strncpy(p_section->stitle, row[2], sizeof(p_section->stitle) - 1); |
| 140 |
p_section->stitle[sizeof(p_section->stitle) - 1] = '\0'; |
p_section->stitle[sizeof(p_section->stitle) - 1] = '\0'; |
| 141 |
strncpy(p_section->master_list, master_list, sizeof(p_section->master_list) - 1); |
strncpy(p_section->master_list, master_list, sizeof(p_section->master_list) - 1); |
| 142 |
p_section->master_list[sizeof(p_section->master_list) - 1] = '\0'; |
p_section->master_list[sizeof(p_section->master_list) - 1] = '\0'; |
| 152 |
{ |
{ |
| 153 |
snprintf(ex_menu_conf, sizeof(ex_menu_conf), "%s/%d", VAR_GEN_EX_MENU_DIR, p_section->sid); |
snprintf(ex_menu_conf, sizeof(ex_menu_conf), "%s/%d", VAR_GEN_EX_MENU_DIR, p_section->sid); |
| 154 |
|
|
| 155 |
ret = load_menu(&ex_menu_set_new, ex_menu_conf); |
// acquire rw lock of all sections to avoid conflict with menu reload in main process |
| 156 |
|
ret = section_list_rw_lock(NULL); |
| 157 |
if (ret < 0) |
if (ret < 0) |
| 158 |
{ |
{ |
| 159 |
log_error("load_menu(%s) error: %d\n", ex_menu_conf, ret); |
log_error("section_list_rw_lock(NULL) error\n"); |
|
unload_menu(&ex_menu_set_new); |
|
| 160 |
} |
} |
| 161 |
else |
else |
| 162 |
{ |
{ |
| 163 |
if (p_section->ex_menu_tm > 0) |
ret = load_menu(&ex_menu_set_new, ex_menu_conf); |
| 164 |
|
if (ret < 0) |
| 165 |
{ |
{ |
| 166 |
unload_menu(&(p_section->ex_menu_set)); |
unload_menu(&ex_menu_set_new); |
| 167 |
|
log_error("load_menu(%s) error: %d\n", ex_menu_conf, ret); |
| 168 |
} |
} |
| 169 |
|
else |
| 170 |
|
{ |
| 171 |
|
if (p_section->ex_menu_tm > 0) |
| 172 |
|
{ |
| 173 |
|
unload_menu(&(p_section->ex_menu_set)); |
| 174 |
|
} |
| 175 |
|
|
| 176 |
ex_menu_set_new.allow_exit = 1; // Allow exit menu |
ex_menu_set_new.allow_exit = 1; // Allow exit menu |
| 177 |
memcpy(&(p_section->ex_menu_set), &ex_menu_set_new, sizeof(ex_menu_set_new)); |
memcpy(&(p_section->ex_menu_set), &ex_menu_set_new, sizeof(ex_menu_set_new)); |
|
set_menu_shm_readonly(&(p_section->ex_menu_set)); |
|
| 178 |
|
|
| 179 |
p_section->ex_menu_tm = atol(row[7]); |
p_section->ex_menu_tm = atol(row[7]); |
| 180 |
#ifdef _DEBUG |
#ifdef _DEBUG |
| 181 |
log_common("Loaded gen_ex_menu of section %d [%s]\n", p_section->sid, p_section->sname); |
log_common("Loaded gen_ex_menu of section %d [%s]\n", p_section->sid, p_section->sname); |
| 182 |
#endif |
#endif |
| 183 |
|
} |
| 184 |
|
|
| 185 |
|
// release rw lock of all sections |
| 186 |
|
ret = section_list_rw_unlock(NULL); |
| 187 |
|
if (ret < 0) |
| 188 |
|
{ |
| 189 |
|
log_error("section_list_rw_unlock(NULL) error\n"); |
| 190 |
|
} |
| 191 |
} |
} |
| 192 |
} |
} |
| 193 |
|
|
| 716 |
SYS_child_process_count = 0; |
SYS_child_process_count = 0; |
| 717 |
|
|
| 718 |
// Detach menu in shared memory |
// Detach menu in shared memory |
| 719 |
detach_menu_shm(p_bbs_menu); |
detach_menu_shm(&bbs_menu); |
|
free(p_bbs_menu); |
|
|
p_bbs_menu = NULL; |
|
| 720 |
|
|
| 721 |
// Set signal handler |
// Set signal handler |
| 722 |
act.sa_handler = SIG_DFL; |
act.sa_handler = SIG_DFL; |
| 813 |
|
|
| 814 |
// gen_ex_menu cleanup |
// gen_ex_menu cleanup |
| 815 |
section_list_ex_menu_set_cleanup(); |
section_list_ex_menu_set_cleanup(); |
| 816 |
|
|
| 817 |
// Detach data pools shm |
// Detach data pools shm |
| 818 |
detach_section_list_shm(); |
detach_section_list_shm(); |
| 819 |
detach_article_block_shm(); |
detach_article_block_shm(); |