| 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); |