| 14 |
* * |
* * |
| 15 |
***************************************************************************/ |
***************************************************************************/ |
| 16 |
|
|
|
#include "section_list_loader.h" |
|
| 17 |
#include "article_cache.h" |
#include "article_cache.h" |
| 18 |
#include "bbs.h" |
#include "bbs.h" |
|
#include "log.h" |
|
| 19 |
#include "database.h" |
#include "database.h" |
| 20 |
|
#include "log.h" |
| 21 |
#include "menu.h" |
#include "menu.h" |
| 22 |
#include <stdio.h> |
#include "section_list_loader.h" |
|
#include <string.h> |
|
| 23 |
#include <errno.h> |
#include <errno.h> |
| 24 |
#include <signal.h> |
#include <signal.h> |
| 25 |
|
#include <stdio.h> |
| 26 |
#include <stdlib.h> |
#include <stdlib.h> |
| 27 |
#include <string.h> |
#include <string.h> |
|
#include <strings.h> |
|
| 28 |
#include <unistd.h> |
#include <unistd.h> |
| 29 |
|
|
| 30 |
int section_list_loader_pid; |
int section_list_loader_pid; |
| 131 |
break; |
break; |
| 132 |
} |
} |
| 133 |
|
|
| 134 |
strncpy(p_section->sname, row[1], sizeof(p_section->sname) - 1); |
strncpy(p_section->sname, row[0], sizeof(p_section->sname) - 1); |
| 135 |
p_section->sname[sizeof(p_section->sname) - 1] = '\0'; |
p_section->sname[sizeof(p_section->sname) - 1] = '\0'; |
| 136 |
strncpy(p_section->stitle, row[1], sizeof(p_section->stitle) - 1); |
strncpy(p_section->stitle, row[1], sizeof(p_section->stitle) - 1); |
| 137 |
p_section->stitle[sizeof(p_section->stitle) - 1] = '\0'; |
p_section->stitle[sizeof(p_section->stitle) - 1] = '\0'; |
| 153 |
} |
} |
| 154 |
|
|
| 155 |
cleanup: |
cleanup: |
| 156 |
|
mysql_free_result(rs2); |
| 157 |
mysql_free_result(rs); |
mysql_free_result(rs); |
| 158 |
mysql_close(db); |
mysql_close(db); |
| 159 |
|
|
| 321 |
mysql_free_result(rs); |
mysql_free_result(rs); |
| 322 |
mysql_close(db); |
mysql_close(db); |
| 323 |
|
|
| 324 |
|
article_cache_cleanup(); |
| 325 |
|
|
| 326 |
return (ret < 0 ? ret : article_count); |
return (ret < 0 ? ret : article_count); |
| 327 |
} |
} |
| 328 |
|
|
| 683 |
} |
} |
| 684 |
else |
else |
| 685 |
{ |
{ |
| 686 |
log_error("Reload section config successfully\n"); |
log_common("Reload section config successfully\n"); |
| 687 |
} |
} |
| 688 |
} |
} |
| 689 |
|
|
| 750 |
|
|
| 751 |
// Child process exit |
// Child process exit |
| 752 |
|
|
| 753 |
|
article_cache_cleanup(); |
| 754 |
|
|
| 755 |
// Detach data pools shm |
// Detach data pools shm |
| 756 |
detach_section_list_shm(); |
detach_section_list_shm(); |
| 757 |
detach_article_block_shm(); |
detach_article_block_shm(); |