version 1.9, 2025/04/15 16:49:36
|
version 1.11, 2025/04/15 21:08:51
|
Line 24
|
Line 24
|
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
* |
* |
* $Log$ |
* $Log$ |
|
* Revision 1.11 2025/04/15 21:08:51 snw |
|
* Add some useful debug output |
|
* |
|
* Revision 1.10 2025/04/15 19:26:13 snw |
|
* Remove extra whitespace |
|
* |
* Revision 1.9 2025/04/15 16:49:36 snw |
* Revision 1.9 2025/04/15 16:49:36 snw |
* Make use of logprintf throughout codebase |
* Make use of logprintf throughout codebase |
* |
* |
Line 169 short shm_init(const size_t seg_size)
|
Line 175 short shm_init(const size_t seg_size)
|
/* grab the pointers we need */ |
/* grab the pointers we need */ |
void *old_addr = shm_config->dta; |
void *old_addr = shm_config->dta; |
void *new_addr = shm_config->hdr->shmad; |
void *new_addr = shm_config->hdr->shmad; |
|
|
|
logprintf (FM_LOG_INFO, "shmmgr: moving shared memory from %p to %p", old_addr, new_addr); |
|
|
/* detach and reattach */ |
/* detach and reattach */ |
if (shmdt (old_addr) == -1) { |
if (shmdt (old_addr) == -1) { |
Line 180 short shm_init(const size_t seg_size)
|
Line 188 short shm_init(const size_t seg_size)
|
#else |
#else |
shm_config->dta = shmat (shm_config->seg_id, new_addr, 0); |
shm_config->dta = shmat (shm_config->seg_id, new_addr, 0); |
#endif |
#endif |
|
|
|
|
|
|
if (shm_config->dta == (void *) -1) { |
if (shm_config->dta == (void *) -1) { |
logprintf (FM_LOG_FATAL, "shm_init: fatal error attaching shared memory segment [shmat error '%s']", strerror (errno)); |
logprintf (FM_LOG_FATAL, "shm_init: fatal error attaching shared memory segment [shmat error '%s']", strerror (errno)); |