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

Diff of /lbbs/src/trie_dict.c

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

Revision 1.18 by sysadm, Mon Nov 17 14:01:13 2025 UTC Revision 1.19 by sysadm, Tue Nov 18 15:15:18 2025 UTC
# Line 114  void trie_dict_cleanup(void) Line 114  void trie_dict_cleanup(void)
114    
115  int set_trie_dict_shm_readonly(void)  int set_trie_dict_shm_readonly(void)
116  {  {
117    #ifndef __CYGWIN__
118          int shmid;          int shmid;
119          void *p_shm;          void *p_shm;
120    
# Line 126  int set_trie_dict_shm_readonly(void) Line 127  int set_trie_dict_shm_readonly(void)
127          shmid = p_trie_node_pool->shmid;          shmid = p_trie_node_pool->shmid;
128    
129          // Remap shared memory in read-only mode          // Remap shared memory in read-only mode
 #if defined(__CYGWIN__)  
         if (shmdt(p_trie_node_pool) == -1)  
         {  
                 log_error("shmdt(trie_node_pool) error (%d)\n", errno);  
                 return -1;  
         }  
         p_shm = shmat(shmid, p_trie_node_pool, SHM_RDONLY);  
 #else  
130          p_shm = shmat(shmid, p_trie_node_pool, SHM_RDONLY | SHM_REMAP);          p_shm = shmat(shmid, p_trie_node_pool, SHM_RDONLY | SHM_REMAP);
 #endif  
131          if (p_shm == (void *)-1)          if (p_shm == (void *)-1)
132          {          {
133                  log_error("shmat(trie_node_pool shmid=%d) error (%d)\n", shmid, errno);                  log_error("shmat(trie_node_pool shmid=%d) error (%d)\n", shmid, errno);
# Line 143  int set_trie_dict_shm_readonly(void) Line 135  int set_trie_dict_shm_readonly(void)
135          }          }
136    
137          p_trie_node_pool = p_shm;          p_trie_node_pool = p_shm;
138    #endif
139    
140          return 0;          return 0;
141  }  }


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

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