/[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.20 by sysadm, Sun May 25 08:15:03 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 496  SECTION_LIST *section_list_create(int32_ Line 496  SECTION_LIST *section_list_create(int32_
496          if (trie_dict_set(p_trie_dict_section_by_sid, sid_str, section_list_count) != 1)          if (trie_dict_set(p_trie_dict_section_by_sid, sid_str, section_list_count) != 1)
497          {          {
498                  log_error("trie_dict_set(section, %d, %d) error\n", sid, section_list_count);                  log_error("trie_dict_set(section, %d, %d) error\n", sid, section_list_count);
                 log_std("Debug %x %x %x %x\n", sid_str[0], sid_str[1], sid_str[2], sid_str[3]);  
499                  return NULL;                  return NULL;
500          }          }
501    
# Line 520  void section_list_reset_articles(SECTION Line 519  void section_list_reset_articles(SECTION
519          p_section->last_page_visible_article_count = 0;          p_section->last_page_visible_article_count = 0;
520  }  }
521    
522  void section_list_pool_cleanup(void)  void section_list_cleanup(void)
523  {  {
524          if (p_trie_dict_section_by_name != NULL)          if (p_trie_dict_section_by_name != NULL)
525          {          {


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

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