--- lbbs/src/file_loader.c 2025/05/20 12:29:26 1.9 +++ lbbs/src/file_loader.c 2025/05/23 14:11:38 1.10 @@ -174,14 +174,8 @@ int load_file_shm(const char *filename) p_line_offsets = p_data + data_len + 1; memcpy(p_line_offsets, line_offsets, sizeof(long) * (size_t)(line_total + 1)); - // Re-mount shm in read-only mode - if (shmdt(p_shm) == -1) - { - log_error("shmdt() error (%d)\n", errno); - return -3; - } - - p_shm = shmat(shmid, NULL, SHM_RDONLY); + // Remap shared memory in read-only mode + p_shm = shmat(shmid, p_shm, SHM_RDONLY | SHM_REMAP); if (p_shm == (void *)-1) { log_error("shmat(shmid=%d) error (%d)\n", shmid, errno);