Add core_get_data_pinned(), use it where possible

Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998
This commit is contained in:
Aidan MacDonald 2023-01-14 18:50:15 +00:00
parent 9e53d5541f
commit 67cb2e3cdc
3 changed files with 19 additions and 6 deletions

View file

@ -80,11 +80,12 @@ int core_load_key_remap(const char *filename)
int handle = core_alloc(bufsize);
if (handle > 0)
{
core_pin(handle);
if (read(fd, core_get_data(handle), bufsize) == (ssize_t)bufsize)
void *data = core_get_data_pinned(handle);
if (read(fd, data, bufsize) == (ssize_t)bufsize)
count = action_set_keymap_handle(handle, count);
core_unpin(handle);
core_put_data_pinned(data);
}
close(fd);