/[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.9 by sysadm, Tue May 20 12:29:26 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          // Re-mount shm in read-only mode          // Remap shared memory in read-only mode
178          if (shmdt(p_shm) == -1)          p_shm = shmat(shmid, p_shm, SHM_RDONLY | SHM_REMAP);
         {  
                 log_error("shmdt() error (%d)\n", errno);  
                 return -3;  
         }  
   
         p_shm = shmat(shmid, NULL, SHM_RDONLY);  
179          if (p_shm == (void *)-1)          if (p_shm == (void *)-1)
180          {          {
181                  log_error("shmat(shmid=%d) error (%d)\n", shmid, errno);                  log_error("shmat(shmid=%d) error (%d)\n", shmid, errno);


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

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