/[LeafOK_CVS]/lbbs/src/section_list.c
ViewVC logotype

Diff of /lbbs/src/section_list.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.18 by sysadm, Sat May 24 15:18:11 2025 UTC Revision 1.19 by sysadm, Sun May 25 06:56:48 2025 UTC
# Line 152  int article_block_init(const char *filen Line 152  int article_block_init(const char *filen
152                          return -3;                          return -3;
153                  }                  }
154    
155                  size = sizeof(shmid) + sizeof(ARTICLE_BLOCK) * (size_t)block_count_in_shm;                  size = sizeof(ARTICLE_BLOCK) * (size_t)block_count_in_shm;
156                  shmid = shmget(key, size, IPC_CREAT | IPC_EXCL | 0600);                  shmid = shmget(key, size, IPC_CREAT | IPC_EXCL | 0600);
157                  if (shmid == -1)                  if (shmid == -1)
158                  {                  {
# Line 361  ARTICLE *article_block_find_by_index(int Line 361  ARTICLE *article_block_find_by_index(int
361          return (p_block->articles + (index % ARTICLE_PER_BLOCK));          return (p_block->articles + (index % ARTICLE_PER_BLOCK));
362  }  }
363    
364  extern int section_list_pool_init(const char *filename)  extern int section_list_init(const char *filename)
365  {  {
366          int semid;          int semid;
367          int shmid;          int shmid;
# Line 374  extern int section_list_pool_init(const Line 374  extern int section_list_pool_init(const
374    
375          if (p_section_list_pool == NULL || p_trie_dict_section_by_name == NULL || p_trie_dict_section_by_sid == NULL)          if (p_section_list_pool == NULL || p_trie_dict_section_by_name == NULL || p_trie_dict_section_by_sid == NULL)
376          {          {
377                  section_list_pool_cleanup();                  section_list_cleanup();
378          }          }
379    
380          proj_id = (int)(time(NULL) % getpid());          proj_id = (int)(time(NULL) % getpid());
# Line 520  void section_list_reset_articles(SECTION Line 520  void section_list_reset_articles(SECTION
520          p_section->last_page_visible_article_count = 0;          p_section->last_page_visible_article_count = 0;
521  }  }
522    
523  void section_list_pool_cleanup(void)  void section_list_cleanup(void)
524  {  {
525          if (p_trie_dict_section_by_name != NULL)          if (p_trie_dict_section_by_name != NULL)
526          {          {


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1