/[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.9 by sysadm, Tue May 20 12:29:26 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            // Re-mount shm in read-only mode
178            if (shmdt(p_shm) == -1)
179            {
180                    log_error("shmdt() error (%d)\n", errno);
181                    return -3;
182            }
183    
184            p_shm = shmat(shmid, NULL, SHM_RDONLY);
185            if (p_shm == (void *)-1)
186            {
187                    log_error("shmat(shmid=%d) error (%d)\n", shmid, errno);
188                    return -3;
189            }
190    
191          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)
192          {          {
193                  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