mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-13 18:17:39 -04:00
Add core_get_data_pinned(), use it where possible
Change-Id: I1b2f62f27780f99423085d2fffc972ea2701f998
This commit is contained in:
parent
9e53d5541f
commit
67cb2e3cdc
3 changed files with 19 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue