| 70 |
return -1; |
return -1; |
| 71 |
} |
} |
| 72 |
|
|
| 73 |
log_std_redirect(STDOUT_FILENO); |
log_common_redir(STDOUT_FILENO); |
| 74 |
log_err_redirect(STDERR_FILENO); |
log_error_redir(STDERR_FILENO); |
| 75 |
|
|
| 76 |
// - 1 to make blocks allocated is less than required, to trigger error handling |
// - 1 to make blocks allocated is less than required, to trigger error handling |
| 77 |
block_count = BBS_article_limit_per_section * BBS_max_section / ARTICLE_PER_BLOCK; |
block_count = BBS_article_limit_per_section * BBS_max_section / ARTICLE_PER_BLOCK; |
| 179 |
article.tid = 0; |
article.tid = 0; |
| 180 |
article.sid = i * 3 + 1; |
article.sid = i * 3 + 1; |
| 181 |
article.cid = article.aid; |
article.cid = article.aid; |
| 182 |
article.uid = 1; // TODO: randomize |
article.uid = 1; |
| 183 |
article.visible = 1; |
article.visible = 1; |
| 184 |
article.excerption = 0; |
article.excerption = 0; |
| 185 |
article.ontop = 0; |
article.ontop = 0; |
| 186 |
article.lock = 0; |
article.lock = 0; |
| 187 |
|
article.transship = 0; |
| 188 |
|
|
| 189 |
if (section_list_rw_lock(p_section[i]) < 0) |
if (section_list_rw_lock(p_section[i]) < 0) |
| 190 |
{ |
{ |
| 302 |
article.tid = ((article.aid < section_first_aid + group_count) ? 0 : (section_first_aid + j % group_count)); |
article.tid = ((article.aid < section_first_aid + group_count) ? 0 : (section_first_aid + j % group_count)); |
| 303 |
article.sid = i * 3 + 1; |
article.sid = i * 3 + 1; |
| 304 |
article.cid = article.aid; |
article.cid = article.aid; |
| 305 |
article.uid = 1; // TODO: randomize |
article.uid = 1; |
| 306 |
article.visible = 1; |
article.visible = 1; |
| 307 |
article.excerption = 0; |
article.excerption = 0; |
| 308 |
article.ontop = 0; |
article.ontop = 0; |
| 309 |
article.lock = 0; |
article.lock = 0; |
| 310 |
|
article.transship = 0; |
| 311 |
|
|
| 312 |
if (section_list_append_article(p_section[i], &article) < 0) |
if (section_list_append_article(p_section[i], &article) < 0) |
| 313 |
{ |
{ |
| 760 |
article.tid = ((article.aid < section_first_aid + group_count) ? 0 : (section_first_aid + j % group_count)); |
article.tid = ((article.aid < section_first_aid + group_count) ? 0 : (section_first_aid + j % group_count)); |
| 761 |
article.sid = i * 3 + 1; |
article.sid = i * 3 + 1; |
| 762 |
article.cid = article.aid; |
article.cid = article.aid; |
| 763 |
article.uid = 1; // TODO: randomize |
article.uid = 1; |
| 764 |
article.visible = 1; |
article.visible = 1; |
| 765 |
article.excerption = 0; |
article.excerption = 0; |
| 766 |
article.ontop = 0; |
article.ontop = 0; |
| 767 |
article.lock = 0; |
article.lock = 0; |
| 768 |
|
article.transship = 0; |
| 769 |
|
|
| 770 |
if (section_list_append_article(p_section[i], &article) < 0) |
if (section_list_append_article(p_section[i], &article) < 0) |
| 771 |
{ |
{ |