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

Diff of /lbbs/src/file_loader.c

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

Revision 1.8 by sysadm, Sun May 18 08:17:25 2025 UTC Revision 1.10 by sysadm, Fri May 23 14:11:38 2025 UTC
# Line 174  int load_file_shm(const char *filename) Line 174  int load_file_shm(const char *filename)
174          p_line_offsets = p_data + data_len + 1;          p_line_offsets = p_data + data_len + 1;
175          memcpy(p_line_offsets, line_offsets, sizeof(long) * (size_t)(line_total + 1));          memcpy(p_line_offsets, line_offsets, sizeof(long) * (size_t)(line_total + 1));
176    
177            // Remap shared memory in read-only mode
178            p_shm = shmat(shmid, p_shm, SHM_RDONLY | SHM_REMAP);
179            if (p_shm == (void *)-1)
180            {
181                    log_error("shmat(shmid=%d) error (%d)\n", shmid, errno);
182                    return -3;
183            }
184    
185          if (trie_dict_get(p_trie_file_dict, filename, (int64_t *)&p_shm_old) == 1)          if (trie_dict_get(p_trie_file_dict, filename, (int64_t *)&p_shm_old) == 1)
186          {          {
187                  shmid_old = *((int *)p_shm_old);                  shmid_old = *((int *)p_shm_old);


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

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